Skip to content

Commit

Permalink
Merge pull request #3 from pldin601/cron
Browse files Browse the repository at this point in the history
Make this f&*king cron work
pyldin601 authored Jul 17, 2017
2 parents 11f3bc7 + 9003d05 commit a35454d
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -8,9 +8,14 @@ RUN apt-get update && \
apt-get clean && \

{ \
echo; \
echo "[program:cron]"; \
echo "command=cron -f"; \
} | tee -a /etc/supervisor/conf.d/cron.conf
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/

@@ -25,8 +30,5 @@ COPY . ./
ARG GIT_CURRENT_COMMIT="<unknown>"
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
2 changes: 2 additions & 0 deletions cronfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0 5 * * * root curl -X POST http://guest:please@localhost:8080/cron/cleanFileSystem
* * * * * root curl -X POST http://guest:please@localhost:8080/cron/generatePeaks

0 comments on commit a35454d

Please sign in to comment.