Spaces:
Runtime error
Runtime error
| # Use an official Python runtime as the base image | |
| FROM python:3.11-slim | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Copy the dependencies file to the working directory | |
| COPY requirements.txt . | |
| # Install the dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Install gunicorn if it's not in requirements.txt | |
| RUN pip install gunicorn | |
| # Copy the rest of the application code to the working directory | |
| COPY . . | |
| # Expose the port that the application will run on | |
| EXPOSE 5000 | |
| # Define the command to run the application | |
| # This uses gunicorn to serve the Flask app | |
| CMD ["gunicorn", "--bind", "0.0.0.0:$PORT", "--workers", "1", "api:app"] |