-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
76 lines (70 loc) · 1.6 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
version: "3.8"
services:
web:
container_name: web
build:
context: ./web
dockerfile: Dockerfile
volumes:
- ./web:/app
environment:
- DB_URL=mongodb://mongo1:30001/angels-among-us?replicaSet=rs0
ports:
- "3000:3000"
depends_on:
mongo-config:
condition: service_completed_successfully
networks:
- angels-among-us
mongo1:
image: mongo:latest
container_name: mongo1
command: ["--replSet", "rs0", "--bind_ip_all", "--port", "30001"]
volumes:
- ./mongo/data1:/data/db
ports:
- 30001:30001
healthcheck:
test: test $$(echo "rs.status().ok" | mongosh --port 30001 --quiet) -eq 1
interval: 10s
start_period: 30s
networks:
- angels-among-us
mongo2:
image: mongo:latest
container_name: mongo2
command: ["--replSet", "rs0", "--bind_ip_all", "--port", "30002"]
volumes:
- ./mongo/data2:/data/db
ports:
- 30002:30002
restart: always
networks:
- angels-among-us
mongo3:
image: mongo:latest
container_name: mongo3
command: ["--replSet", "rs0", "--bind_ip_all", "--port", "30003"]
volumes:
- ./mongo/data3:/data/db
ports:
- 30003:30003
restart: always
networks:
- angels-among-us
mongo-config:
container_name: mongo-config
image: mongo:latest
depends_on:
- mongo1
- mongo2
- mongo3
volumes:
- ./scripts:/scripts
entrypoint: ['/scripts/rs-init.sh']
restart: on-failure
networks:
- angels-among-us
networks:
angels-among-us:
driver: bridge