Same scheduler qbit-maid uses: entrypoint.sh writes the crontab and execs crond -f. Drops the supercronic package from the image. - crontab lives in /tmp/crontabs because the rootfs is read-only - MAILTO= keeps job output on crond's stdout/stderr (container log), which is what supercronic -passthrough-logs provided - busybox crond only loads crontab files owned by uid 0 and calls initgroups() per job, so the container needs root + CAP_SETGID; the entrypoint now fails fast (exit 78) when it is not root - no @reboot job: a container restart must not start a backup
25 lines
738 B
Docker
25 lines
738 B
Docker
FROM python:3.13-alpine
|
|
|
|
# mariadb-client -> mariadb-dump
|
|
# restic -> the backup engine
|
|
# docker-cli -> only used when COLD_BACKUP=true (docker exec into seafile)
|
|
# busybox crond -> the scheduler (ships with the base image, no extra package)
|
|
RUN apk add --no-cache \
|
|
mariadb-client \
|
|
restic \
|
|
docker-cli \
|
|
tzdata \
|
|
&& adduser -u 99 -D -G users -h /config -s /sbin/nologin backup
|
|
|
|
COPY seafile-backup.py /usr/local/bin/seafile-backup
|
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
RUN chmod 0755 /usr/local/bin/seafile-backup /usr/local/bin/entrypoint.sh
|
|
|
|
ENV HOME=/tmp \
|
|
PYTHONUNBUFFERED=1 \
|
|
PYTHONDONTWRITEBYTECODE=1
|
|
|
|
USER 99:100
|
|
|
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|