File size: 955 Bytes
3619192
5e234f7
 
3619192
5e234f7
 
3619192
 
08268df
 
5e234f7
 
 
 
3619192
 
08268df
3619192
5e234f7
 
 
3619192
 
 
 
 
f59b927
3619192
5e234f7
 
3619192
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Utilisation d'une image Python légère
FROM python:3.10-slim

# Définir le répertoire de travail
WORKDIR /app

# Installation des dépendances système minimales
RUN apt-get update && apt-get install -y --no-install-recommends \
    git \
    git-lfs \
    libgl1-mesa-glx \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

# Installer Git LFS et récupérer les fichiers nécessaires
RUN git lfs install

# Copier uniquement les fichiers nécessaires pour optimiser la mise en cache
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copier le reste du projet
COPY . .

# Récupérer les fichiers LFS explicitement
RUN git lfs pull && ls -lh IAPLD.h5
RUN pip install python-multipart
# Exposer le port attendu par Hugging Face Spaces
EXPOSE 7860

# Démarrer l'application FastAPI avec Uvicorn
ENTRYPOINT ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1", "--timeout-keep-alive", "600"]