Eric2mangel commited on
Commit
b4d3ea9
·
verified ·
1 Parent(s): 2962c2e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -18
Dockerfile CHANGED
@@ -1,27 +1,33 @@
 
1
  FROM python:3.12-slim
2
 
3
- RUN pip install --upgrade pip
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  WORKDIR /app
6
 
7
- RUN apt-get update && apt-get install -y \
8
- build-essential \
9
- curl \
10
- git \
11
- && rm -rf /var/lib/apt/lists/*
12
-
13
- COPY requirements.txt ./
14
- RUN pip3 install -r requirements.txt
15
 
16
- COPY app.py ./
17
- COPY faker_text.csv ./
18
- COPY numeric_only.csv ./
19
- # COPY src/ ./src/ # décommente si tu as vraiment ce dossier
20
 
 
21
  EXPOSE 8501
22
 
23
- # ←←← LIGNE À REMPLACER
24
- HEALTHCHECK --interval=30s --timeout=30s --start-period=10s --retries=5 \
25
- CMD curl -f http://localhost:8501/_stcore/health || curl -f http://localhost:8501/healthz || exit 1
26
-
27
- CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.headless=true"]
 
1
+ # syntax = docker/dockerfile:1.4
2
  FROM python:3.12-slim
3
 
4
+ # Installe les dépendances système nécessaires pour Pillow, matplotlib, etc.
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ gcc \
7
+ g++ \
8
+ libjpeg62-turbo-dev \
9
+ zlib1g-dev \
10
+ libpng-dev \
11
+ libfreetype6-dev \
12
+ liblcms2-dev \
13
+ libwebp-dev \
14
+ libopenjp2-7-dev \
15
+ libtiff5-dev \
16
+ && rm -rf /var/lib/apt/lists/*
17
 
18
  WORKDIR /app
19
 
20
+ # Copie et installe les dépendances Python
21
+ COPY requirements.txt .
22
+ RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
23
 
24
+ # Copie le code et les données
25
+ COPY app.py .
26
+ COPY faker_text.csv .
27
+ COPY numeric_only.csv .
28
 
29
+ # Très important pour HF Spaces
30
  EXPOSE 8501
31
 
32
+ # Commande de lancement (obligatoire)
33
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]