| # File: Dockerfile | |
| # Use an official Python runtime as a parent image | |
| FROM python:3.10-slim | |
| # Create and set the working directory | |
| WORKDIR /app | |
| # Copy the requirements file into the container | |
| COPY requirements.txt /app/ | |
| # Install any needed packages specified in requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of the application code into the container | |
| COPY . /app | |
| # Install Gunicorn | |
| RUN pip install gunicorn | |
| # Expose the port that the app runs on | |
| EXPOSE 5000 | |
| # Command to run the application using Gunicorn | |
| CMD ["gunicorn", "app:app", "-b", "0.0.0.0:5000", "-w", "2", "--threads", "4", "--timeout", "120"] | |