| FROM python:3.12-slim | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| COPY app.py . | |
| RUN pip install --upgrade pip | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| RUN pip install gunicorn | |
| EXPOSE 7860 | |
| CMD ["gunicorn", "app:app", \ | |
| "-w", "4", \ | |
| "--worker-class", "gevent", \ | |
| "--worker-connections", "100", \ | |
| "-b", "0.0.0.0:7860", \ | |
| "--timeout", "120", \ | |
| "--keep-alive", "5", \ | |
| "--max-requests", "1000", \ | |
| "--max-requests-jitter", "100"] |