MB-IDK commited on
Commit
6e8fbba
·
verified ·
1 Parent(s): 70cc91c

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # Hugging Face Spaces expose le port 7860
4
+ ENV CGPT_PORT=7860
5
+ ENV CGPT_HOST=0.0.0.0
6
+ ENV CGPT_LOG_LEVEL=INFO
7
+ ENV CGPT_POOL_SIZE=2
8
+ ENV CGPT_RATE_LIMIT=15
9
+
10
+ WORKDIR /app
11
+
12
+ COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ COPY app.py .
16
+
17
+ EXPOSE 7860
18
+
19
+ # Gunicorn pour la production — timeout long pour le streaming SSE
20
+ CMD ["gunicorn", \
21
+ "--bind", "0.0.0.0:7860", \
22
+ "--workers", "2", \
23
+ "--threads", "4", \
24
+ "--timeout", "300", \
25
+ "--keep-alive", "65", \
26
+ "--worker-class", "gthread", \
27
+ "--access-logfile", "-", \
28
+ "--error-logfile", "-", \
29
+ "app:application"]