add Dockerfile to dump the db
This commit is contained in:
parent
2740ccc280
commit
c9f608be59
4 changed files with 23 additions and 7 deletions
|
@ -1,7 +0,0 @@
|
|||
version: '3'
|
||||
services:
|
||||
mongo-dump:
|
||||
image: "mongo:latest"
|
||||
command: ["mongodump", "--host", "eventman-mongo", "--out", "/tmp/", "--db", "eventman"]
|
||||
external_links:
|
||||
- eventman_eventman-mongo_1:eventman-mongo
|
8
docker-compose-mongodump.yml
Normal file
8
docker-compose-mongodump.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
version: '3'
|
||||
services:
|
||||
mongo-dump:
|
||||
build: ./docker-tools/mongodump/
|
||||
volumes:
|
||||
- .:/data
|
||||
external_links:
|
||||
- eventman_eventman-mongo_1:eventman-mongo
|
9
docker-tools/mongodump/Dockerfile
Normal file
9
docker-tools/mongodump/Dockerfile
Normal file
|
@ -0,0 +1,9 @@
|
|||
FROM mongo:latest
|
||||
LABEL \
|
||||
maintainer="Davide Alberani <da@erlug.linux.it>" \
|
||||
vendor="RaspiBO"
|
||||
|
||||
VOLUME ["/data"]
|
||||
|
||||
COPY run.sh /
|
||||
CMD ["/run.sh"]
|
6
docker-tools/mongodump/run.sh
Executable file
6
docker-tools/mongodump/run.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
mongodump --host eventman-mongo --out /tmp/ --db eventman
|
||||
cd /tmp
|
||||
tar cfz /data/eventman-dump-`date +'%Y-%m-%dT%H.%M.%S'`.tgz eventman
|
||||
|
Loading…
Reference in a new issue