OUAREDAEK commited on
Commit
2b2dc01
·
verified ·
1 Parent(s): 85c4f24

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -0
Dockerfile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dockerfile
2
+ FROM python:3.9-slim
3
+
4
+ WORKDIR /app
5
+
6
+ # Installer les dépendances système
7
+ RUN apt-get update && apt-get install -y gcc g++ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # Copier les requirements d'abord pour optimiser le cache
10
+ COPY requirements.txt .
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # Copier le reste des fichiers
14
+ COPY . .
15
+
16
+ # Créer les répertoires nécessaires
17
+ RUN mkdir -p data logs
18
+
19
+ # Variables d'environnement
20
+ ENV FLASK_APP=app.py
21
+ ENV FLASK_ENV=production
22
+ ENV PYTHONUNBUFFERED=1
23
+
24
+ # Exposition du port
25
+ EXPOSE 7860
26
+
27
+ # Commande de démarrage
28
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "2", "--threads", "4", "--timeout", "120", "app:app"]