Liantsoaxx08 commited on
Commit
3619192
·
1 Parent(s): 08268df

modifing dockerfile content

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -13
Dockerfile CHANGED
@@ -1,29 +1,32 @@
1
- # Use a lightweight Python base image
2
  FROM python:3.10-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Install Git and Git LFS
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
- # Copy all files (including .gitattributes for LFS)
16
- COPY . .
17
-
18
- # Fetch LFS files explicitly
19
- RUN git lfs install && git lfs pull
20
 
21
- # Copy requirements file and install dependencies
22
  COPY requirements.txt .
23
  RUN pip install --no-cache-dir -r requirements.txt
24
 
25
- # Expose the port Hugging Face Spaces expects
 
 
 
 
 
 
26
  EXPOSE 7860
27
 
28
- # Run the FastAPI app with Uvicorn
29
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
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"]