From 469c7abf251f6ae6c20bdfb1ee03ff13f0944c72 Mon Sep 17 00:00:00 2001 From: zeus Date: Fri, 20 Nov 2020 22:08:11 +0200 Subject: [PATCH] set --- Dockerfile | 11 +++++++++++ bootstrap-cron.sh | 4 ++++ startup.sh | 29 +++++++++++++++++++++++++---- 3 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 bootstrap-cron.sh diff --git a/Dockerfile b/Dockerfile index 8f5d5df..88294a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ LABEL MAINTAINERS="Guillaume Scheibel , Damien DUP # build/llo-base-images/asciidoctor-alpine/docker-asciidoctor RUN apk add --no-cache \ bash \ + cron \ curl \ ca-certificates \ findutils \ @@ -38,6 +39,16 @@ RUN apk add --no-cache --virtual .pythonmakedepends \ seqdiag \ && apk del -r --no-cache .pythonmakedepends +# # Copy hello-cron file to the cron.d directory +COPY bootstrap-cron.sh /etc/cron.d/playground-cron + +# Give execution rights on the cron job +RUN chmod 0744 /etc/cron.d/playground-cron + +# Apply cron job +RUN crontab /etc/cron.d/playground-cron + + RUN ln -s /usr/local/bin/node /usr/bin/node ADD supervisord.conf /etc/supervisor/supervisord.conf diff --git a/bootstrap-cron.sh b/bootstrap-cron.sh new file mode 100644 index 0000000..9b320aa --- /dev/null +++ b/bootstrap-cron.sh @@ -0,0 +1,4 @@ +*/10 * * * * node /home/node/crond/playground-sync.sh >> /home/node/logs/cron.log 2>&1 +# An empty line is required at the end of this file for a valid cron file. + + diff --git a/startup.sh b/startup.sh index d775f26..d36bd48 100644 --- a/startup.sh +++ b/startup.sh @@ -52,10 +52,15 @@ chmod +x /home/$USER/crond/playground.config.js read -r -d '' VAR < /home/$USER/crond/playground-sync.sh chmod +x /home/$USER/crond/playground-sync.sh + +# --------------------------- +# install npm +# -------------------------- +read -r -d '' VAR < /home/$USER/crond/playground-sync.sh + + + # ***************************************************** # ***************************************************** # ELSE