Spaces:
Sleeping
Sleeping
| # 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"] | |