diff --git a/.drone.yml b/.drone.yml index 434b648..98fcab2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,7 +2,6 @@ kind: pipeline type: docker name: SmartFit_AI - trigger: event: - push @@ -10,7 +9,6 @@ trigger: - master steps: - # docker image build - name: docker-build-and-push image: plugins/docker settings: @@ -22,8 +20,6 @@ steps: password: from_secret: jolys_username - - # container deployment - name: deploy-container image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest environment: @@ -32,4 +28,4 @@ steps: COMMAND: create OVERWRITE: true ADMINS: remiarnal,enzojolys,othmanebenjelloun - depends_on: ["docker-build-and-push"] \ No newline at end of file + depends_on: ["docker-build-and-push"] diff --git a/Dockerfile b/Dockerfile index 7833cca..fdf2191 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,33 +1,12 @@ FROM python:3.10 - EXPOSE 80 - WORKDIR /app - -# Copier les fichiers nécessaires dans l'image -COPY requirements.txt . -COPY generateurModele.py . -COPY testFinal.py . -COPY crontab . - -# Installer les dépendances -RUN pip install -r requirements.txt - -# Créer le fichier de log -RUN touch /app/cron.log - -# Donner les permissions nécessaires -RUN chmod 777 /app/crontab - -# Installer le service cron +COPY . . +# 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 - +RUN chmod 0644 /app/crontab RUN crontab /app/crontab RUN crontab -l - -# Définir le point d'entrée de l'image -ENTRYPOINT ["service","cron","restart"] +# Python +RUN pip install -r requirements.txt +ENTRYPOINT ["cron","-f"] diff --git a/crontab b/crontab index 1288fb1..23b03a7 100644 --- a/crontab +++ b/crontab @@ -1,3 +1,2 @@ -* * * * * python3 /app/testFinal.py -00 08 * * * python3 /app/generateurModele.py +*/1 * * * * python3 /app/generateurModele.py diff --git a/generateurModele.py b/generateurModele.py index 6ee848a..2046039 100644 --- a/generateurModele.py +++ b/generateurModele.py @@ -55,7 +55,7 @@ def sendJsonToApi(url,json): # ---------------- Main ------------------- # -urlGetAllData = "https://codefirst.iut.uca.fr/containers/SmartFit-smartfit_api/ia/data" +urlGetAllData = "https://codefirst.iut.uca.fr/containers/SmartFit-smartfit_api/ai/data" while(True): logging.warning("Info - Début de la boucle") jsonBack = { "Users" : []}