Spaces:
Sleeping
Sleeping
| # ---------------------------------------------------- | |
| # STAGE 1 : Build (Installation des dépendances) | |
| # ---------------------------------------------------- | |
| # Utilisation de la dernière image slim de Python 3.12 | |
| FROM python:3.12-slim | |
| # Définition du répertoire de travail à l'intérieur du conteneur | |
| WORKDIR /app | |
| # Installation des dépendances système nécessaires | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| curl \ | |
| git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copie du fichier des dépendances Python | |
| COPY requirements.txt ./ | |
| # Installation des dépendances Python | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # ---------------------------------------------------- | |
| # STAGE 2 : Application (Copie du code et exécution) | |
| # ---------------------------------------------------- | |
| # CORRECTION : Copie de app.py à la racine du WORKDIR (/app) | |
| # Assurez-vous que votre fichier app.py est bien à la racine de votre contexte de build local. | |
| COPY app.py ./ | |
| # Port exposé par Streamlit | |
| EXPOSE 8501 | |
| # Vérification de santé | |
| HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health | |
| # CORRECTION : Point d'entrée pour démarrer l'application Streamlit | |
| ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"] |