|
@@ -1,21 +1,16 @@
|
1
|
|
-# Utiliser une image Python de base
|
2
|
|
-FROM python:3.11
|
|
1
|
+FROM python:3.11-slim
|
3
|
2
|
|
|
3
|
+RUN pip install poetry \
|
|
4
|
+ && poetry config virtualenvs.create false
|
4
|
5
|
RUN useradd --create-home --shell /bin/bash user
|
5
|
6
|
USER user
|
6
|
7
|
|
7
|
|
-# Créer un répertoire de travail
|
8
|
|
-WORKDIR /home/user/mil
|
9
|
8
|
|
10
|
|
-COPY docker/requirements.txt ./
|
|
9
|
+WORKDIR /home/user/million
|
|
10
|
+COPY pyproject.toml poetry.lock ./
|
11
|
11
|
|
12
|
|
-RUN pip install --no-cache-dir --upgrade pip \
|
13
|
|
- && pip install --no-cache-dir -r requirements.txt
|
|
12
|
+RUN poetry install --no-dev
|
14
|
13
|
|
15
|
|
-# Copier le script Python et tout autre fichier nécessaire dans le conteneur
|
16
|
|
-COPY python/script.py .
|
17
|
|
-COPY data/html_content.html data/
|
|
14
|
+COPY million/ ./
|
18
|
15
|
|
19
|
|
-
|
20
|
|
-# Définir la commande par défaut pour exécuter le script Python
|
21
|
|
-CMD ["python", "script.py"]
|
|
16
|
+# CMD ["poetry", "run", "python", "million/scripts/script.py"]
|