forked from futurist/mongodb-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gzip and archive functionality to mongo backup
- Loading branch information
Showing
5 changed files
with
66 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM mongo:latest | ||
MAINTAINER Steven Tsang <[email protected]> | ||
FROM library/mongo:3.4 | ||
LABEL maintainer="Steven Tsang <[email protected]>" | ||
|
||
RUN apt-get update && apt-get -y install cron && mkdir -p /backup | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: '3.2' | ||
services: | ||
mongodbbackup: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
mongodb: | ||
image: 'mongo:latest' | ||
environment: | ||
- MONGODB_PASS=mypass | ||
ports: | ||
- "27017:27017" | ||
- "28017:28017" | ||
mongodbbackup: | ||
image: 'tsangste/mongodb-backup:latest' | ||
links: | ||
- mongodb | ||
environment: | ||
- CRON_TIME=20 3 * * * #Change to your favorate cron job schedule | ||
- MAX_BACKUPS=10 | ||
- INIT_BACKUP=yes | ||
volumes: | ||
- /host/backup:/backup #Change to the host folder where you want to store the backups | ||
version: '3.2' | ||
services: | ||
mongodb: | ||
image: 'library/mongo:3.4' | ||
environment: | ||
- MONGODB_PASS=mypass | ||
ports: | ||
- "27017:27017" | ||
- "28017:28017" | ||
mongodbbackup: | ||
image: 'tsangste/mongodb-backup:latest' | ||
links: | ||
- mongodb | ||
environment: | ||
- CRON_TIME=20 3 * * * #Change to your favourite cron job schedule | ||
- MAX_BACKUPS=10 | ||
- INIT_BACKUP=yes | ||
- USE_GZIP=yes | ||
- USE_ARCHIVE=yes | ||
volumes: | ||
- /srv/backup:/backup #Change to the host folder where you want to store the backups |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters