Cyrano2 commited on
Commit
155e956
·
verified ·
1 Parent(s): e002b46

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -0
Dockerfile CHANGED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Variables d'environnement pour Hugging Face Spaces
4
+ ENV PYTHONUNBUFFERED=1
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+
7
+ WORKDIR /app
8
+
9
+ # Installer les dépendances système nécessaires
10
+ RUN apt-get update && apt-get install -y --no-install-recommends \
11
+ gcc \
12
+ g++ \
13
+ libhdf5-dev \
14
+ && rm -rf /var/lib/apt/lists/* \
15
+ && apt-get clean
16
+
17
+ # Copier et installer les dépendances Python
18
+ COPY requirements.txt .
19
+ RUN pip install --no-cache-dir --upgrade pip && \
20
+ pip install --no-cache-dir -r requirements.txt
21
+
22
+ # Copier l'application
23
+ COPY app.py .
24
+
25
+ # Port pour Hugging Face Spaces (obligatoire: 7860)
26
+ EXPOSE 7860
27
+
28
+ # Créer un utilisateur non-root (requis par HF Spaces)
29
+ RUN useradd -m -u 1000 user
30
+ USER user
31
+
32
+ # Démarrer l'application
33
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]