| 1 | FROM debian:bookworm-slim |
| 2 | |
| 3 | RUN apt-get update && \ |
| 4 | apt-get install -y --no-install-recommends sqlite3 awscli cron && \ |
| 5 | rm -rf /var/lib/apt/lists/* |
| 6 | |
| 7 | COPY apps/backup/backup.sh /usr/local/bin/backup.sh |
| 8 | RUN chmod +x /usr/local/bin/backup.sh |
| 9 | |
| 10 | # restore.sh ships for reference; run it on the HOST (it shells out to `docker run` |
| 11 | # and the backup container mounts the data volumes read-only). |
| 12 | COPY apps/backup/restore.sh /usr/local/bin/restore.sh |
| 13 | RUN chmod +x /usr/local/bin/restore.sh |
| 14 | |
| 15 | COPY apps/backup/crontab /etc/cron.d/backup-cron |
| 16 | RUN chmod 0644 /etc/cron.d/backup-cron && crontab /etc/cron.d/backup-cron |
| 17 | |
| 18 | CMD ["sh", "-c", "printenv | grep -E '^(R2_|AWS_|RETENTION)' >> /etc/environment && cron -f"] |