2025-11-22 19:13:34 +00:00
|
|
|
FROM python:3.11-slim
|
|
|
|
|
|
|
|
|
|
# Set environment variables
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE 1
|
|
|
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
|
|
|
|
|
|
# Set work directory
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Install system dependencies
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
|
gcc \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
# Copy requirements and install Python dependencies
|
|
|
|
|
COPY requirements.txt .
|
|
|
|
|
RUN pip install --no-cache-dir --upgrade pip
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
# Copy project
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
# Collect static files
|
|
|
|
|
RUN python manage.py collectstatic --noinput
|
|
|
|
|
|
|
|
|
|
# Expose port
|
2025-11-23 14:06:30 +00:00
|
|
|
EXPOSE 8081
|
2025-11-22 19:13:34 +00:00
|
|
|
|
|
|
|
|
# Run migrations and start Gunicorn
|
2025-11-23 14:06:30 +00:00
|
|
|
CMD sh -c "python manage.py migrate && gunicorn booking_system.wsgi:application --bind 0.0.0.0:8081 --workers 3"
|