-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (24 loc) · 1.13 KB
/
Dockerfile
File metadata and controls
35 lines (24 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM alpine:3.21.3
ARG RESTIC_VERSION=~0.17
ARG CRON_VERSION=~4
ENV BACKUP_SCHEDULE="0 0 * * *"
ENV FORGET_SCHEDULE="0 0 * * *"
ENV RESTIC_SOURCE="/source/"
ENV RESTIC_REPOSITORY="/backup/"
ENV RESTIC_PASSWORD_FILE="/run/secrets/backup_password"
ENV RESTIC_COMPRESSION="auto"
ENV RESTIC_BACKUP_ARGS="--exclude-caches --exclude-if-present=.nobackup --exclude-file=/.backupignore"
ENV RESTIC_FORGET_ARGS="--prune --keep-last 7 --keep-daily 14 --keep-weekly 4 --keep-monthly 6 --keep-yearly 1"
ENV MOUNT_LOCK_TEST="false"
ENV MOUNT_LOCK_FILE="/.mounted"
RUN apk add --no-cache restic=$RESTIC_VERSION dcron=$CRON_VERSION
COPY scripts/entrypoint.sh /entrypoint.sh
COPY scripts/backup.sh /backup.sh
COPY scripts/forget.sh /forget.sh
COPY scripts/restore.sh /restore.sh
RUN touch /.backupignore && touch /var/log/backup.log && touch /var/log/forget.log
RUN chmod +x /entrypoint.sh /backup.sh /forget.sh /restore.sh
VOLUME ["/source", "/backup"]
HEALTHCHECK --interval=1m --timeout=1m --start-period=5s CMD restic check --no-lock | grep -q "no errors were found"
#checkov:skip=CKV_DOCKER_3:too many permissions issues
ENTRYPOINT [ "/entrypoint.sh" ]