From c91604b3dfa89125b20683bb0e4d88217c9f827e Mon Sep 17 00:00:00 2001 From: Roman Lakhtadyr Date: Mon, 17 Jul 2017 18:46:33 +0300 Subject: [PATCH 1/4] Hot fix --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b966cf2f..55ba0cef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,9 +8,10 @@ RUN apt-get update && \ apt-get clean && \ { \ + echo; \ echo "[program:cron]"; \ echo "command=cron -f"; \ - } | tee -a /etc/supervisor/conf.d/cron.conf + } | tee -a /etc/supervisor/supervisord.conf WORKDIR /usr/app/ From 6bcce6b63841a9ecd315661d84608863ccfc68fb Mon Sep 17 00:00:00 2001 From: Roman Lakhtadyr Date: Mon, 17 Jul 2017 19:02:52 +0300 Subject: [PATCH 2/4] Refactoring, fix PATH variable inside crontab file --- Dockerfile | 7 ++----- cronfile | 4 ++++ 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 cronfile diff --git a/Dockerfile b/Dockerfile index 55ba0cef..b97cf35b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,8 +26,5 @@ COPY . ./ ARG GIT_CURRENT_COMMIT="" ENV GIT_CURRENT_COMMIT=${GIT_CURRENT_COMMIT} -ARG CRON_ENDPOINT="http://guest:please@localhost:8080/cron" -RUN ({ \ - echo "0 5 * * * curl -X POST ${CRON_ENDPOINT}/cleanFileSystem"; \ - echo "* * * * * curl -X POST ${CRON_ENDPOINT}/generatePeaks"; \ - } | tee /etc/cron.d/musicloud-cron) && chmod 0644 /etc/cron.d/musicloud-cron +COPY cronfile /etc/cron.d/musicloud.cronfile +RUN chmod 0644 /etc/cron.d/musicloud-cronfile diff --git a/cronfile b/cronfile new file mode 100644 index 00000000..df11f024 --- /dev/null +++ b/cronfile @@ -0,0 +1,4 @@ +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +0 5 * * * curl -X POST http://guest:please@localhost:8080/cron/cleanFileSystem +* * * * * curl -X POST http://guest:please@localhost:8080/cron/generatePeaks From f11f2f9a4b58bb5f61ddfe6f4b6e4de799fe116f Mon Sep 17 00:00:00 2001 From: Roman Lakhtadyr Date: Mon, 17 Jul 2017 19:03:15 +0300 Subject: [PATCH 3/4] Refactoring, fix PATH variable inside crontab file --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b97cf35b..4da1d998 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,4 +27,4 @@ ARG GIT_CURRENT_COMMIT="" ENV GIT_CURRENT_COMMIT=${GIT_CURRENT_COMMIT} COPY cronfile /etc/cron.d/musicloud.cronfile -RUN chmod 0644 /etc/cron.d/musicloud-cronfile +RUN chmod 0644 /etc/cron.d/musicloud.cronfile From 9003d05a6ff10dc35fb7d503435f0b9fefa76d51 Mon Sep 17 00:00:00 2001 From: Roman Lakhtadyr Date: Mon, 17 Jul 2017 19:23:33 +0300 Subject: [PATCH 4/4] Fix cron startup --- Dockerfile | 4 ++++ cronfile | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4da1d998..d39b5423 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,10 @@ RUN apt-get update && \ echo; \ echo "[program:cron]"; \ echo "command=cron -f"; \ + echo "stdout_logfile=/dev/stdout"; \ + echo "stdout_logfile_maxbytes=0"; \ + echo "stderr_logfile=/dev/stderr"; \ + echo "stderr_logfile_maxbytes=0"; \ } | tee -a /etc/supervisor/supervisord.conf WORKDIR /usr/app/ diff --git a/cronfile b/cronfile index df11f024..a921e2eb 100644 --- a/cronfile +++ b/cronfile @@ -1,4 +1,2 @@ -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -0 5 * * * curl -X POST http://guest:please@localhost:8080/cron/cleanFileSystem -* * * * * curl -X POST http://guest:please@localhost:8080/cron/generatePeaks +0 5 * * * root curl -X POST http://guest:please@localhost:8080/cron/cleanFileSystem +* * * * * root curl -X POST http://guest:please@localhost:8080/cron/generatePeaks