Spaces:
Sleeping
Sleeping
Commit ·
3619192
1
Parent(s): 08268df
modifing dockerfile content
Browse files- Dockerfile +16 -13
Dockerfile
CHANGED
|
@@ -1,29 +1,32 @@
|
|
| 1 |
-
#
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
#
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
RUN apt-get update && apt-get install -y \
|
| 9 |
git \
|
| 10 |
git-lfs \
|
| 11 |
libgl1-mesa-glx \
|
| 12 |
libglib2.0-0 \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
# Fetch LFS files explicitly
|
| 19 |
-
RUN git lfs install && git lfs pull
|
| 20 |
|
| 21 |
-
#
|
| 22 |
COPY requirements.txt .
|
| 23 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
|
| 25 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
EXPOSE 7860
|
| 27 |
|
| 28 |
-
#
|
| 29 |
-
|
|
|
|
| 1 |
+
# Utilisation d'une image Python légère
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Définir le répertoire de travail
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Installation des dépendances système minimales
|
| 8 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 9 |
git \
|
| 10 |
git-lfs \
|
| 11 |
libgl1-mesa-glx \
|
| 12 |
libglib2.0-0 \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
+
# Installer Git LFS et récupérer les fichiers nécessaires
|
| 16 |
+
RUN git lfs install
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
# Copier uniquement les fichiers nécessaires pour optimiser la mise en cache
|
| 19 |
COPY requirements.txt .
|
| 20 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
+
# Copier le reste du projet
|
| 23 |
+
COPY . .
|
| 24 |
+
|
| 25 |
+
# Récupérer les fichiers LFS explicitement
|
| 26 |
+
RUN git lfs pull && ls -lh IAPLD.h5
|
| 27 |
+
|
| 28 |
+
# Exposer le port attendu par Hugging Face Spaces
|
| 29 |
EXPOSE 7860
|
| 30 |
|
| 31 |
+
# Démarrer l'application FastAPI avec Uvicorn
|
| 32 |
+
ENTRYPOINT ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1", "--timeout-keep-alive", "600"]
|