# Use an official Python runtime as a parent image FROM python:3.11-slim # Set the working directory in the container WORKDIR /app # Install curl for health check RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* # Copy the requirements file into the container COPY requirements.txt . # Install any needed packages specified in requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Copy the current directory contents into the container at /app COPY . . # Make port 80 available to the world outside this container EXPOSE 80 # Add health check HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD curl http://localhost || exit 1 # Run the application using Gunicorn CMD ["gunicorn", "--bind", "0.0.0.0:80", "--workers", "4", "wsgi:app"]