# Production backups (decision 156): MongoDB's tools to dump (and test-restore) every
# database, and rclone to keep the dumps in an S3-compatible bucket (Cloudflare R2).
#   docker build -t tas-backup deploy/backup
FROM rclone/rclone:1.68.2 AS rclone

# MongoDB's image for its tools (mongodump, mongorestore) and, for the restore test, mongod.
FROM mongo:8.0
COPY --from=rclone /usr/local/bin/rclone /usr/local/bin/rclone
COPY backup.sh restore-test.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/backup.sh /usr/local/bin/restore-test.sh
ENTRYPOINT []
CMD ["backup.sh"]
