# Stage 1: Base Python image
FROM python:3.10

# Set working directory
WORKDIR /app

# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy all Django files
COPY . .

# Collect static files
RUN python manage.py collectstatic --noinput

# Expose Django port (not directly accessible)
EXPOSE 8000

# Run Gunicorn server
CMD ["gunicorn", "routineapi.wsgi:application", "--bind", "0.0.0.0:8000"]
