-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
55 lines (52 loc) · 1.41 KB
/
docker-compose.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
version: "3.9"
services:
mongo-setup:
container_name: mongo-setup
image: mongo
restart: on-failure
volumes:
- ./scripts:/scripts
entrypoint: [ "/scripts/setup.sh" ] # Make sure this file exists
depends_on:
- mongo1
- mongo2
- mongo3
mongo1:
hostname: mongo1
container_name: mongo1
image: mongo
expose:
- 27017
ports:
- 27017:27017
restart: always
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0", "--journal", "--dbpath", "/data/db", "--enableMajorityReadConcern", "false" ]
volumes:
- ./data1:/data/db
- ./data1/configdb:/data/configdb
mongo2:
hostname: mongo2
container_name: mongo2
image: mongo
expose:
- 27017
ports:
- 27018:27017
restart: always
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0", "--journal", "--dbpath", "/data/db", "--enableMajorityReadConcern", "false" ]
volumes:
- ./data2:/data/db
- ./data2/configdb:/data/configdb
mongo3:
hostname: mongo3
container_name: mongo3
image: mongo
expose:
- 27017
ports:
- 27019:27017
restart: always
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0", "--journal", "--dbpath", "/data/db", "--enableMajorityReadConcern", "false" ]
volumes:
- ./data3:/data/db
- ./data3/configdb:/data/configdb