diff --git a/Dockerfile b/Dockerfile index 31ca5b6..b3d4d28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,17 @@ RUN apk add --no-cache \ libxml2 \ libxslt \ tzdata \ - dcron + curl + +ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.2.33/supercronic-linux-amd64 \ + SUPERCRONIC_SHA1SUM=71b0d58cc53f6bd72cf2f293e09e294b79c666d8 \ + SUPERCRONIC=supercronic-linux-amd64 + +RUN curl -fsSLO "$SUPERCRONIC_URL" \ + && echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic COPY --from=builder /usr/local/lib/python3.10 /usr/local/lib/python3.10 COPY --from=builder /app /app @@ -40,6 +50,5 @@ ENV PYTHONPATH=/usr/local/lib/python3.10/site-packages COPY . . -RUN echo -e "SHELL=/bin/sh\nPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n" > /etc/crontabs/root - -CMD echo "${CRON:-0 0 * * *} python /app/cleanmedia.py ${CLEANMEDIA_OPTS:--t 30}" >> /etc/crontabs/root && crond -f -l 2 +CMD echo "${CRON:-0 0 * * *} python /app/cleanmedia.py ${CLEANMEDIA_OPTS:-c /etc/dendrite/dendrite.yaml -t 30 -n -l}" > /app/crontab && \ + /usr/local/bin/supercronic /app/crontab