Spaces:
Runtime error
Runtime error
| # Use an official Python runtime as a parent image | |
| FROM python:3.9-slim | |
| # Set the working directory | |
| WORKDIR /app | |
| # Install dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Install spaCy model | |
| RUN python -m spacy download en_core_web_sm | |
| # Copy the current directory contents into the container | |
| COPY . . | |
| # Expose the port FastAPI will run on | |
| EXPOSE 7860 | |
| # Command to run the application with Gunicorn and Uvicorn workers | |
| # CMD ["uvicorn", "app.main:server", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"] | |
| CMD ["uvicorn", "app.main:server", "--host", "0.0.0.0", "--port", "7860", "--workers", "4", "--timeout-keep-alive", "60", "--timeout-graceful-shutdown", "60"] | |