File size: 642 Bytes
6e8fbba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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"]