This is a Docker image for periodically backing up MongoDB databases.
Written in 2016 by Evan Prodromou [email protected]
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/.
The image is available on Docker Hub as fuzzyio/backup-mongodb.
docker pull fuzzyio/backup-mongodb
The container makes a daily date-stamped backup of the MongoDB database you
specify to its /backup
directory. You'll typically want to attach a volume
to the container so that it backs up to a location under your control.
The image uses the following environment variables:
- HOST: The host to connect to for getting the database. Can be a plain
hostname like
server1
or a replication set definition likemyrepl/server1,server2,server3
. - DATABASE The database to back up. This image will only back up one database; run multiple containers if you need multiple databases backed up.
An example Docker Compose file:
version: '2'
services:
foobar:
image: mongo:3.2
backup:
image: fuzzyio/backup-mongodb
links:
- foobar:foobar
volumes:
- ./backup:/backup
environment:
HOST: foobar
DATABASE: bazquux