-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose-storedb.yml
61 lines (58 loc) · 1.4 KB
/
docker-compose-storedb.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
version: "2.4"
volumes:
mongo_data_restore:
driver: local
driver_opts:
device: $COMPOSEPATH/data/mongorestore
o: bind
type: bind
postgres_data_restore:
driver: local
driver_opts:
device: $COMPOSEPATH/data/postgresrestore
o: bind
type: bind
services:
mongostore:
image: mongo:4.0
hostname: mongostore
command: >
sh -c "set -xe
&& ANAME=/home/mongodb-`date +%Y%m%d-%H-%M`.archive
&& mongodump --host=mongo -u noc -p noc -d noc --archive=$$ANAME
"
restart: "no"
volumes:
- mongo_data_restore:/home
logging:
driver: $COMPOSE_LOG_DRIVER
options:
max-size: $COMPOSE_LOG_MAX_SIZE
max-file: $COMPOSE_LOG_MAX_FILE
labels:
traefik.enable: false
postgresstore:
image: postgres:9.6
hostname: postgresstore
command: >
sh -c "set -xe
&& env
&& echo "-----------------------"
&& pg_dump -h postgres -U noc -Fc noc > /home/pg-`date +%Y%m%d-%H-%M`.dump
"
restart: "no"
volumes:
- postgres_data_restore:/home
environment:
POSTGRES_USER: noc
POSTGRES_DB: noc
POSTGRES_PASSWORD: $NOC_PG_PASSWORD
PGPASSWORD: $NOC_PG_PASSWORD
logging:
driver: $COMPOSE_LOG_DRIVER
options:
max-size: $COMPOSE_LOG_MAX_SIZE
max-file: $COMPOSE_LOG_MAX_FILE
labels:
traefik.enable: false