-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
85 lines (77 loc) · 1.76 KB
/
docker-compose.yml
File metadata and controls
85 lines (77 loc) · 1.76 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
version: '2.2'
volumes:
mongodata1:
mongodata2:
mongodata3:
services:
mongo:
image: mongo:4.4.7
restart: on-failure
depends_on:
- mongo2
- mongo3
container_name: mongo
hostname: mongo
volumes:
- mongodata1:/data/db
ports:
- '27016:27016'
entrypoint:
[
'/usr/bin/mongod',
'--replSet',
'my-replica-set',
'--bind_ip_all',
'--port',
'27016',
]
healthcheck:
test: test $$(echo "rs.initiate({_id:'my-replica-set',members:[{_id:0,host:\"mongo:27016\",priority:4},{_id:1,host:\"mongo2:27018\",priority:3},{_id:2,host:\"mongo3:27019\",priority:3}]}).ok || rs.status().ok" | mongo --port 27016 --quiet) -eq 1
start_period: 30s
mongo2:
image: mongo:4.4.7
restart: always
hostname: mongo2
container_name: mongo2
volumes:
- mongodata2:/data/db
ports:
- '27018:27018'
entrypoint:
[
'/usr/bin/mongod',
'--replSet',
'my-replica-set',
'--bind_ip_all',
'--port',
'27018',
]
mongo3:
image: mongo:4.4.7
restart: always
container_name: mongo3
hostname: mongo3
volumes:
- mongodata3:/data/db
ports:
- '27019:27019'
entrypoint:
[
'/usr/bin/mongod',
'--replSet',
'my-replica-set',
'--bind_ip_all',
'--port',
'27019',
]
seed-data:
image: custom-mongo-seeding:local
build:
context: .
dockerfile: ./sample-data/Dockerfile
depends_on:
- mongo
environment:
DB_HOST: ${MONGO_SEED_DB_HOST}
DB_PORT: ${MONGO_SEED_DB_PORT}
DB_NAME: project