docker-crontab/Dockerfile

27 lines
776 B
Docker
Raw Normal View History

FROM alpine:3.12 as rq-build
ENV RQ_VERSION=1.0.2
WORKDIR /root/
RUN apk --update add upx \
&& wget https://github.com/dflemstr/rq/releases/download/v${RQ_VERSION}/rq-v${RQ_VERSION}-x86_64-unknown-linux-musl.tar.gz \
&& tar -xvf rq-v1.0.2-x86_64-unknown-linux-musl.tar.gz \
&& upx --brute rq
FROM library/docker:stable
2017-02-12 16:28:53 -07:00
COPY --from=rq-build /root/rq /usr/local/bin
2017-02-12 16:28:53 -07:00
ENV HOME_DIR=/opt/crontab
RUN apk add --no-cache --virtual .run-deps gettext jq bash tini \
2017-11-14 14:04:30 -07:00
&& mkdir -p ${HOME_DIR}/jobs ${HOME_DIR}/projects \
&& adduser -S docker -D
2017-02-12 16:28:53 -07:00
COPY docker-entrypoint /
ENTRYPOINT ["/sbin/tini", "--", "/docker-entrypoint"]
2017-02-12 16:28:53 -07:00
HEALTHCHECK --interval=5s --timeout=3s \
CMD ps aux | grep '[c]rond' || exit 1
CMD ["crond", "-f", "-d", "6", "-c", "/etc/crontabs"]