-
Notifications
You must be signed in to change notification settings - Fork 193
/
Copy pathdocker-compose.yml
131 lines (122 loc) · 3.39 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: ack-nestjs-boilerplate
services:
apis:
build:
context: .
container_name: apis
hostname: apis
ports:
- 3000:3000
volumes:
- ./src/:/app/src/
- .env/:/app/.env
restart: on-failure
networks:
- app-network
depends_on:
- redis
- mongodb1
redis:
image: redis:latest
container_name: redis
hostname: redis
restart: on-failure
ports:
- '6379:6379'
volumes:
- redis_data:/data
networks:
- app-network
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 30s
retries: 5
redis-bullboard:
image: deadly0/bull-board:3.2.6
container_name: redis-bullboard
hostname: redis-bullboard
restart: on-failure
ports:
- 3010:3000
networks:
- app-network
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
- BULL_PREFIX=bull
- USER_LOGIN=admin
- USER_PASSWORD=admin123
depends_on:
- redis
mongodb1:
image: mongo:latest
container_name: mongodb1
hostname: mongodb1
restart: on-failure
ports:
- '27017:27017'
links:
- mongodb2
- mongodb3
depends_on:
mongodb2:
condition: service_started
mongodb3:
condition: service_started
networks:
- app-network
volumes:
- mongodb1_data:/data/db
- mongodb1_config:/data/configdb
command: mongod --bind_ip_all --replSet rs0 --port 27017
extra_hosts:
- 'host.docker.internal:host-gateway'
healthcheck:
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'host.docker.internal:27017',priority:1},{_id:1,host:'host.docker.internal:27018',priority:0.5},{_id:2,host:'host.docker.internal:27019',priority:0.5}]}) }" | mongosh --port 27017 --quiet
interval: 5s
timeout: 30s
start_period: 0s
start_interval: 1s
retries: 10
mongodb2:
image: mongo:latest
container_name: mongodb2
hostname: mongodb2
networks:
- app-network
restart: on-failure
ports:
- '27018:27018'
volumes:
- mongodb2_data:/data/db
- mongodb2_config:/data/configdb
command: mongod --bind_ip_all --replSet rs0 --port 27018
extra_hosts:
- 'host.docker.internal:host-gateway'
mongodb3:
image: mongo:latest
container_name: mongodb3
hostname: mongodb3
networks:
- app-network
restart: on-failure
ports:
- '27019:27019'
volumes:
- mongodb3_data:/data/db
- mongodb3_config:/data/configdb
command: mongod --bind_ip_all --replSet rs0 --port 27019
extra_hosts:
- 'host.docker.internal:host-gateway'
volumes:
mongodb1_data:
mongodb2_data:
mongodb3_data:
mongodb1_config:
mongodb2_config:
mongodb3_config:
redis_data:
networks:
app-network:
driver: bridge