abdelbarredazia commited on
Commit
b486eae
·
verified ·
1 Parent(s): 0b5f2a1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -2
Dockerfile CHANGED
@@ -5,13 +5,14 @@ WORKDIR /app
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
8
- # Créer le cache Hugging Face avec droits d'écriture
9
  RUN mkdir -p /app/cache && chmod -R 777 /app/cache
10
 
11
- # (Optionnel) pré-télécharger le modèle pour éviter runtime download
12
  RUN HF_HOME=/app/cache TRANSFORMERS_CACHE=/app/cache \
13
  python -c "from transformers import pipeline; pipeline('sentiment-analysis')"
14
 
15
  COPY . .
16
 
 
17
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
 
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
8
+ # Créer cache et donner droits universels
9
  RUN mkdir -p /app/cache && chmod -R 777 /app/cache
10
 
11
+ # Pré-télécharger le modèle (optionnel mais recommandé)
12
  RUN HF_HOME=/app/cache TRANSFORMERS_CACHE=/app/cache \
13
  python -c "from transformers import pipeline; pipeline('sentiment-analysis')"
14
 
15
  COPY . .
16
 
17
+ # (si tu veux forcer root : pas besoin de chown, sinon ajoute un USER non-root après chmod)
18
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]