try
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
5f22c3a531
commit
91eacbb2cf
@ -1,17 +1,30 @@
|
|||||||
FROM python:3.10
|
FROM python:3.10
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY requirements.txt .
|
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
|
||||||
|
|
||||||
|
# Copier les fichiers nécessaires dans l'image
|
||||||
|
COPY requirements.txt .
|
||||||
COPY generateurModele.py .
|
COPY generateurModele.py .
|
||||||
COPY testFinal.py .
|
COPY testFinal.py .
|
||||||
COPY crontab .
|
COPY crontab .
|
||||||
|
|
||||||
|
# Installer les dépendances
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Créer le fichier de log
|
||||||
RUN touch /app/cron.log
|
RUN touch /app/cron.log
|
||||||
|
|
||||||
|
# Donner les permissions nécessaires
|
||||||
RUN chmod 777 /app/crontab
|
RUN chmod 777 /app/crontab
|
||||||
RUN apt-get update
|
|
||||||
RUN apt-get -y install cron
|
|
||||||
|
|
||||||
ENTRYPOINT [ "cron" ,"&&","tail","-f", "/app/cron.log"]
|
# Installer le service cron
|
||||||
|
RUN apt-get update && apt-get -y install cron
|
||||||
|
|
||||||
|
# Copier le script d'entrée
|
||||||
|
COPY entrypoint.sh /app/entrypoint.sh
|
||||||
|
RUN chmod +x /app/entrypoint.sh
|
||||||
|
|
||||||
|
# Définir le point d'entrée de l'image
|
||||||
|
ENTRYPOINT ["/app/entrypoint.sh"]
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Charger le fichier cron
|
||||||
|
crontab /app/crontab
|
||||||
|
|
||||||
|
# Démarrer le service cron en arrière-plan
|
||||||
|
service cron start
|
||||||
|
|
||||||
|
cron && tail -f /app/cron.log
|
Loading…
Reference in new issue