Skip to content

Instantly share code, notes, and snippets.

@peterwillcn
Forked from mhubig/Dockerfile
Created November 17, 2017 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterwillcn/fd3da3c2e82756bf428839616905d2a7 to your computer and use it in GitHub Desktop.
Save peterwillcn/fd3da3c2e82756bf428839616905d2a7 to your computer and use it in GitHub Desktop.
Alpine Linux based cronjob runner
FROM alpine:latest
RUN apk add --update php python py-pip mysql-client \
&& pip install awscli \
&& rm -rf /var/cache/apk/*
RUN touch crontab.tmp \
&& echo '* */6 * * * /usr/bin/php /var/www/partkeepr/app/console partkeepr:cron:run' > crontab.tmp \
&& echo '0 2 * * * /usr/bin/sql_backup' >> crontab.tmp \
&& crontab crontab.tmp \
&& rm -rf crontab.tmp
CMD [/usr/sbin/crond, -f, -d, 0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment