-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yaml
47 lines (44 loc) · 937 Bytes
/
docker-compose.yaml
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
version: "3.7"
volumes:
mongo-keyfile:
mongo-data-1:
mongo-data-2:
mongo-data-3:
mongo-config-1:
mongo-config-2:
mongo-config-3:
#service template
x-mongodb:
&mongodb
image: mongo:5.0.9
restart: unless-stopped
labels:
docker.service: mongodb
command: --keyFile /data/keyfile/keyfile --replSet 'rs1'
deploy:
replicas: 1
env_file:
- .env
#This is the base service for production and development
#list of services
services:
mongo1:
<<: *mongodb
labels:
docker.service: manager
volumes:
- mongo-data-1:/data/db
- mongo-config-1:/data/configdb
- mongo-keyfile:/data/keyfile
mongo2:
<<: *mongodb
volumes:
- mongo-data-2:/data/db
- mongo-config-2:/data/configdb
- mongo-keyfile:/data/keyfile
mongo3:
<<: *mongodb
volumes:
- mongo-data-3:/data/db
- mongo-config-3:/data/configdb
- mongo-keyfile:/data/keyfile