FROM python:3.9-slim-buster WORKDIR /app # Install dependencies first for layer caching COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application code COPY . . # Expose the port Gunicorn will listen on EXPOSE 8000 # Run the application with Gunicorn CMD ["gunicorn", "--bind", "0.0.0.0:8000", "my_app.wsgi:application"]