Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +16 -6
Dockerfile
CHANGED
|
@@ -1,23 +1,33 @@
|
|
| 1 |
FROM python:3.10
|
| 2 |
|
| 3 |
-
# ✅
|
| 4 |
-
# ✅ Ajoute les outils de compilation nécessaires pour llama-cpp
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
build-essential \
|
| 7 |
cmake \
|
| 8 |
git \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
WORKDIR /app
|
| 12 |
|
|
|
|
| 13 |
COPY requirements.txt .
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 19 |
|
|
|
|
| 20 |
EXPOSE 7860
|
| 21 |
|
|
|
|
| 22 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 23 |
-
|
|
|
|
| 1 |
FROM python:3.10
|
| 2 |
|
| 3 |
+
# ✅ Installer les outils nécessaires pour llama-cpp
|
|
|
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
build-essential \
|
| 6 |
cmake \
|
| 7 |
git \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
+
# ✅ Crée un dossier cache autorisé dans le container (important pour Hugging Face)
|
| 11 |
+
ENV HF_HOME=/app/cache
|
| 12 |
+
ENV TRANSFORMERS_CACHE=/app/cache
|
| 13 |
+
ENV HF_MODULES_CACHE=/app/cache
|
| 14 |
+
ENV HF_HUB_CACHE=/app/cache
|
| 15 |
+
|
| 16 |
+
# ✅ Crée le dossier de cache avec droits d’accès
|
| 17 |
+
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
|
| 18 |
+
|
| 19 |
+
# Dossier de travail
|
| 20 |
WORKDIR /app
|
| 21 |
|
| 22 |
+
# Installer les dépendances
|
| 23 |
COPY requirements.txt .
|
| 24 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
|
| 26 |
+
# Copier le code
|
| 27 |
+
COPY . .
|
|
|
|
| 28 |
|
| 29 |
+
# ✅ Exposer le port API
|
| 30 |
EXPOSE 7860
|
| 31 |
|
| 32 |
+
# ✅ Lancer FastAPI
|
| 33 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|