jurgenbollo commited on
Commit
d3024b5
·
verified ·
1 Parent(s): b8b828b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -9
Dockerfile CHANGED
@@ -1,10 +1,13 @@
1
  FROM python:3.9-slim
2
 
 
3
  WORKDIR /app
 
 
4
  ENV HOME=/app
5
  ENV STREAMLIT_HOME=/app/.streamlit
6
 
7
- # Installation des dépendances système (traductions corrigées)
8
  RUN apt-get update && apt-get install -y \
9
  build-essential \
10
  curl \
@@ -12,23 +15,22 @@ RUN apt-get update && apt-get install -y \
12
  git \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # Copier les dépendances Python
16
- COPY requirements.txt .
17
 
18
- # Copier le dossier src (code + modèles + .streamlit/config.toml)
 
19
  COPY src/ ./src/
20
-
21
- # Copier le dossier de configuration Streamlit
22
  COPY src/.streamlit/ /app/.streamlit/
23
 
24
- # Installer les dépendances Python
25
  RUN pip3 install --no-cache-dir -r requirements.txt
26
 
27
  # Exposer le port Streamlit
28
  EXPOSE 8501
29
 
30
- # Vérification de la santé
31
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
32
 
33
- # Lancer l'application Streamlit
34
  ENTRYPOINT ["streamlit", "run", "src/streamlit_app1.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
1
  FROM python:3.9-slim
2
 
3
+ # Définir le dossier de travail
4
  WORKDIR /app
5
+
6
+ # Rediriger le HOME de streamlit
7
  ENV HOME=/app
8
  ENV STREAMLIT_HOME=/app/.streamlit
9
 
10
+ # Installer les dépendances système
11
  RUN apt-get update && apt-get install -y \
12
  build-essential \
13
  curl \
 
15
  git \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
+ # Créer le dossier .streamlit avec les bonnes permissions
19
+ RUN mkdir -p /app/.streamlit && chmod -R 777 /app/.streamlit
20
 
21
+ # Copier les fichiers du projet
22
+ COPY requirements.txt .
23
  COPY src/ ./src/
 
 
24
  COPY src/.streamlit/ /app/.streamlit/
25
 
26
+ # Installer les paquets Python
27
  RUN pip3 install --no-cache-dir -r requirements.txt
28
 
29
  # Exposer le port Streamlit
30
  EXPOSE 8501
31
 
32
+ # Vérification de santé
33
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
34
 
35
+ # Lancer lapplication Streamlit
36
  ENTRYPOINT ["streamlit", "run", "src/streamlit_app1.py", "--server.port=8501", "--server.address=0.0.0.0"]