-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.override.yml
221 lines (214 loc) · 4.85 KB
/
docker-compose.override.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
services:
mysql:
image: mysql:8.0
container_name: mysql-container
ports:
- "3306:3306"
networks:
- app-network
environment:
MYSQL_ROOT_PASSWORD: 1234
MYSQL_DATABASE: dev_db
MYSQL_USER: honey
MYSQL_PASSWORD: 1234
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test:
["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p1234"]
interval: 10s
timeout: 5s
retries: 3
command: --bind-address=0.0.0.0
collaborative_room1:
build:
context: .
dockerfile: ./packages/collaborative/Dockerfile
container_name: collaborative-room1
ports:
- "3001:3001"
- "9001:9001"
depends_on:
redis:
condition: service_healthy
mysql:
condition: service_healthy
mongodb:
condition: service_healthy
environment:
- MYSQL_HOST=mysql-container
- MYSQL_PORT=3306
- MYSQL_DATABASE=dev_db
- MYSQL_PASSWORD=1234
- MYSQL_USER=honey
- NODE_ENV=dev
- MONGO_HOST=mongodb-container
- MONGO_USER=honey
- MONGO_PASSWORD=1234
- MONGO_DB=dev_db
- LOG_LEVEL=debug
- REDIS_HOST=redis-container
- REDIS_USERNAME=honey
- REDIS_PORT=6530
- REDIS_PASSWORD=1234
- SERVER_ID=room1
- WS_PORT=9001
networks:
- app-network
collaborative_room2:
build:
context: .
dockerfile: ./packages/collaborative/Dockerfile
container_name: collaborative-room2
ports:
- "3002:3002"
- "9002:9002"
depends_on:
redis:
condition: service_healthy
mysql:
condition: service_healthy
mongodb:
condition: service_healthy
environment:
- MYSQL_HOST=mysql-container
- MYSQL_PORT=3306
- MYSQL_DATABASE=dev_db
- MYSQL_PASSWORD=1234
- MYSQL_USER=honey
- NODE_ENV=dev
- MONGO_HOST=mongodb-container
- MONGO_USER=honey
- MONGO_PASSWORD=1234
- MONGO_DB=dev_db
- LOG_LEVEL=debug
- REDIS_HOST=redis-container
- REDIS_USERNAME=honey
- REDIS_PORT=6530
- REDIS_PASSWORD=1234
- SERVER_ID=room2
- WS_PORT=9002
networks:
- app-network
api:
build:
context: .
dockerfile: ./packages/api/Dockerfile
container_name: api
ports:
- "3000:3000"
depends_on:
mysql:
condition: service_healthy
mongodb:
condition: service_healthy
environment:
- MYSQL_HOST=mysql-container
- MYSQL_PORT=3306
- MYSQL_DATABASE=dev_db
- MYSQL_PASSWORD=1234
- MYSQL_USER=honey
- NODE_ENV=dev
- MONGO_HOST=mongodb-container
- MONGO_USER=honey
- MONGO_PASSWORD=1234
- MONGO_DB=dev_db
- LOG_LEVEL=debug
networks:
- app-network
load-balancer:
build:
context: .
dockerfile: ./packages/loadbalancer/Dockerfile
container_name: lb-container
ports:
- "4242:4242"
depends_on:
redis:
condition: service_healthy
networks:
- app-network
environment:
- LOG_LEVEL=debug
- REDIS_HOST=redis-container
- REDIS_USERNAME=honey
- REDIS_PORT=6530
- REDIS_PASSWORD=1234
frotend:
build:
context: .
dockerfile: ./packages/frontend/Dockerfile
container_name: frontend
ports:
- "80:80"
depends_on:
load-balancer:
condition: service_started
collaborative_room1:
condition: service_started
collaborative_room2:
condition: service_started
api:
condition: service_started
networks:
- app-network
mongodb:
image: mongo:latest
container_name: mongodb-container
ports:
- "27017:27017"
networks:
- app-network
environment:
MONGO_INITDB_ROOT_USERNAME: honey
MONGO_INITDB_ROOT_PASSWORD: 1234
MONGO_INITDB_DATABASE: dev_db
MONGODB_AUTH_MECHANISM: SCRAM-SHA-256
command: ["mongod", "--bind_ip", "0.0.0.0"]
volumes:
- mongo_data:/data/db
healthcheck:
test:
[
"CMD",
"mongosh",
"--username",
"honey",
"--password",
"1234",
"--eval",
"db.runCommand({ ping: 1 })",
]
interval: 10s
timeout: 5s
retries: 10
redis:
image: redis:latest
container_name: redis-container
ports:
- "6530:6530"
networks:
- app-network
environment:
REDIS_DISABLE_COMMANDS: "FLUSHDB FLUSHALL"
command:
[
"redis-server",
"--port",
"6530",
"--requirepass",
"1234",
"--bind",
"0.0.0.0",
]
healthcheck:
test: ["CMD", "redis-cli", "-p", "6530", "ping"]
interval: 10s
timeout: 5s
retries: 3
volumes:
mysql_data:
mongo_data:
networks:
app-network:
driver: bridge