Docker image to backup MongoDB 4.0 to S3 using mongodump and compress using pigz.
- Supports custom S3 endpoints (e.g. minio)
- Uses piping instead of tmp file
- Compression is done with pigz (parallel gzip)
- Creates bucket if it's not created
- Can be run in Kubernetes or Docker
- PGP encryption
- TODO: Add other compression methods
- TODO: Add other dbs (e.g. postgres, mysql)
S3_BUCK=mongo1-backups
S3_NAME=folder-name/backup-name-prefix
S3_URI=https://s3-key:[email protected]
MONGO_URI=mongodb://mongo-host:27017/db-name
GPG_KEYSERVER=keyserver.ubuntu.com # your hpks keyserver
GPG_KEYID=<key_id> # recipient key, backup will be encrypted if added
Or see docker-compose.yml
file to run this container with Docker.
See kubernetes.cronjob.yml
file.