Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- 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
|
| 9 |
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
|
| 10 |
|
| 11 |
-
#
|
| 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"]
|