Spaces:
Running
Running
| FROM python:3.11-slim | |
| # Hugging Face Spaces expose le port 7860 | |
| ENV CGPT_PORT=7860 | |
| ENV CGPT_HOST=0.0.0.0 | |
| ENV CGPT_LOG_LEVEL=INFO | |
| ENV CGPT_POOL_SIZE=2 | |
| ENV CGPT_RATE_LIMIT=15 | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY app.py . | |
| EXPOSE 7860 | |
| # Gunicorn pour la production — timeout long pour le streaming SSE | |
| CMD ["gunicorn", \ | |
| "--bind", "0.0.0.0:7860", \ | |
| "--workers", "2", \ | |
| "--threads", "4", \ | |
| "--timeout", "300", \ | |
| "--keep-alive", "65", \ | |
| "--worker-class", "gthread", \ | |
| "--access-logfile", "-", \ | |
| "--error-logfile", "-", \ | |
| "app:application"] |