Spaces:
Sleeping
Sleeping
Commit ·
ffa1e68
1
Parent(s): 65f530a
src model_path
Browse files- .dockerignore +4 -0
- .gitignore +20 -0
- Dockerfile +45 -9
- {model_paths → src/model_paths}/model_ols_Déblais_gravats.pkl +0 -0
- {model_paths → src/model_paths}/model_ols_Déchets_verts.pkl +0 -0
- {model_paths → src/model_paths}/model_ols_Encombrants.pkl +0 -0
- {model_paths → src/model_paths}/model_ols_Matériaux_recyclables.pkl +0 -0
- {model_paths → src/model_paths}/model_ols_Total_autres_dechets.pkl +0 -0
.dockerignore
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
secrets.env
|
| 2 |
+
.env
|
| 3 |
+
.git
|
| 4 |
+
.DS_Store
|
.gitignore
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
secrets.env
|
| 2 |
+
bloc6_projetfinal.pptx
|
| 3 |
+
Data
|
| 4 |
+
pkl
|
| 5 |
+
|
| 6 |
+
# Fichiers sensibles
|
| 7 |
+
secrets.env
|
| 8 |
+
.env
|
| 9 |
+
|
| 10 |
+
# Fichiers Python inutiles
|
| 11 |
+
__pycache__/
|
| 12 |
+
*.py[cod]
|
| 13 |
+
*$py.class
|
| 14 |
+
|
| 15 |
+
# Fichiers système/macOS
|
| 16 |
+
.DS_Store
|
| 17 |
+
|
| 18 |
+
# Dossier Git
|
| 19 |
+
.git/
|
| 20 |
+
|
Dockerfile
CHANGED
|
@@ -1,20 +1,56 @@
|
|
| 1 |
-
FROM python:3.13.5-slim
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
COPY src/ ./src/
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
| 15 |
|
|
|
|
| 16 |
EXPOSE 8501
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# FROM python:3.13.5-slim
|
| 2 |
+
|
| 3 |
+
# WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# RUN apt-get update && apt-get install -y \
|
| 6 |
+
# build-essential \
|
| 7 |
+
# curl \
|
| 8 |
+
# git \
|
| 9 |
+
# && rm -rf /var/lib/apt/lists/*
|
| 10 |
+
|
| 11 |
+
# COPY requirements.txt ./
|
| 12 |
+
# COPY src/ ./src/
|
| 13 |
+
|
| 14 |
+
# RUN pip3 install -r requirements.txt
|
| 15 |
|
| 16 |
+
# EXPOSE 8501
|
| 17 |
+
|
| 18 |
+
# HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 19 |
+
|
| 20 |
+
# ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
| 21 |
+
|
| 22 |
+
# 1. Utilise une image Python légère et récente
|
| 23 |
+
FROM python:3.13.5-slim
|
| 24 |
WORKDIR /app
|
| 25 |
|
| 26 |
+
# 2. Installe uniquement les dépendances système nécessaires
|
| 27 |
+
# et nettoie immédiatement après
|
| 28 |
+
RUN apt-get update && \
|
| 29 |
+
apt-get install -y --no-install-recommends \
|
| 30 |
+
curl \
|
| 31 |
+
git \
|
| 32 |
&& rm -rf /var/lib/apt/lists/*
|
| 33 |
|
| 34 |
+
# 3. Copie uniquement requirements.txt et installe les dépendances Python
|
| 35 |
+
# en évitant le cache pip
|
| 36 |
+
COPY requirements.txt .
|
| 37 |
+
RUN pip install --no-cache-dir -r requirements.txt && \
|
| 38 |
+
rm -f requirements.txt
|
| 39 |
+
|
| 40 |
+
# 4. Copie le reste du code
|
| 41 |
COPY src/ ./src/
|
| 42 |
|
| 43 |
+
# 5. Nettoie les caches Python inutiles
|
| 44 |
+
RUN find /app -type d -name __pycache__ -exec rm -r {} + && \
|
| 45 |
+
find /app -type f -name "*.pyc" -delete
|
| 46 |
|
| 47 |
+
# 6. Expose le port
|
| 48 |
EXPOSE 8501
|
| 49 |
|
| 50 |
+
# 7. Healthcheck
|
| 51 |
+
HEALTHCHECK --interval=30s --timeout=3s \
|
| 52 |
+
CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
| 53 |
|
| 54 |
+
# 8. Lance l'application
|
| 55 |
+
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", \
|
| 56 |
+
"--server.port=8501", "--server.address=0.0.0.0"]
|
{model_paths → src/model_paths}/model_ols_Déblais_gravats.pkl
RENAMED
|
File without changes
|
{model_paths → src/model_paths}/model_ols_Déchets_verts.pkl
RENAMED
|
File without changes
|
{model_paths → src/model_paths}/model_ols_Encombrants.pkl
RENAMED
|
File without changes
|
{model_paths → src/model_paths}/model_ols_Matériaux_recyclables.pkl
RENAMED
|
File without changes
|
{model_paths → src/model_paths}/model_ols_Total_autres_dechets.pkl
RENAMED
|
File without changes
|