jurgenbollo's picture
Update Dockerfile
d3024b5 verified
Raw
History Blame
947 Bytes
FROM python:3.9-slim
# Définir le dossier de travail
WORKDIR /app
# Rediriger le HOME de streamlit
ENV HOME=/app
ENV STREAMLIT_HOME=/app/.streamlit
# Installer les dépendances système
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*
# Créer le dossier .streamlit avec les bonnes permissions
RUN mkdir -p /app/.streamlit && chmod -R 777 /app/.streamlit
# Copier les fichiers du projet
COPY requirements.txt .
COPY src/ ./src/
COPY src/.streamlit/ /app/.streamlit/
# Installer les paquets Python
RUN pip3 install --no-cache-dir -r requirements.txt
# Exposer le port Streamlit
EXPOSE 8501
# Vérification de santé
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
# Lancer l’application Streamlit
ENTRYPOINT ["streamlit", "run", "src/streamlit_app1.py", "--server.port=8501", "--server.address=0.0.0.0"]