forked from huangsihao7/scooter-WSVA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
364 lines (361 loc) · 8.28 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
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
version: '3.8'
services:
#user_rpc
scooter-user-rpc:
build:
context: ./backend
dockerfile: deployments/user_rpc.Dockerfile
container_name: scooter-user-rpc
env_file:
- .env
networks:
- scooter
depends_on:
- mysql
- redis
restart: unless-stopped
#relation_rpc
scooter-relation-rpc:
build:
context: ./backend
dockerfile: deployments/relation_rpc.Dockerfile
container_name: scooter-relation-rpc
env_file:
- .env
networks:
- scooter
depends_on:
- mysql
- scooter-user-rpc
restart: unless-stopped
#live_rpc
scooter-live-rpc:
build:
context: ./backend
dockerfile: deployments/live_rpc.Dockerfile
container_name: scooter-live-rpc
env_file:
- .env
networks:
- scooter
depends_on:
- scooter-user-rpc
restart: unless-stopped
#label_rpc
scooter-label-rpc:
build:
context: ./backend
dockerfile: deployments/label_rpc.Dockerfile
container_name: scooter-label-rpc
env_file:
- .env
networks:
- scooter
depends_on:
- mysql
restart: unless-stopped
#favorite_rpc
scooter-favorite-rpc:
build:
context: ./backend
dockerfile: deployments/favorite_rpc.Dockerfile
container_name: scooter-favorite-rpc
env_file:
- .env
networks:
- scooter
depends_on:
- mysql
- scooter-user-rpc
- redis
restart: unless-stopped
#comment_rpc
scooter-comment-rpc:
build:
context: ./backend
dockerfile: deployments/comment_rpc.Dockerfile
container_name: scooter-comment-rpc
env_file:
- .env
networks:
- scooter
depends_on:
- mysql
- scooter-user-rpc
restart: unless-stopped
#feed_rpc
scooter-feed-rpc:
build:
context: ./backend
dockerfile: deployments/feed_rpc.Dockerfile
container_name: scooter-feed-rpc
env_file:
- .env
networks:
- scooter
depends_on:
- mysql
- scooter-user-rpc
- gorse
- kafka
restart: unless-stopped
#user_api
scooter-user-api:
build:
context: ./backend
dockerfile: deployments/user_api.Dockerfile
container_name: scooter-user-api
env_file:
- .env
ports:
- 8890:8890
networks:
- scooter
depends_on:
- scooter-user-rpc
restart: unless-stopped
#relation_api
scooter-relation-api:
build:
context: ./backend
dockerfile: deployments/relation_api.Dockerfile
container_name: scooter-relation-api
env_file:
- .env
ports:
- 8893:8893
networks:
- scooter
depends_on:
- scooter-relation-rpc
restart: unless-stopped
#live_api
scooter-live-api:
build:
context: ./backend
dockerfile: deployments/live_api.Dockerfile
container_name: scooter-live-api
env_file:
- .env
ports:
- 8896:8896
networks:
- scooter
depends_on:
- scooter-live-rpc
restart: unless-stopped
#favorite_api
scooter-favorite-api:
build:
context: ./backend
dockerfile: deployments/favorite_api.Dockerfile
container_name: scooter-favorite-api
env_file:
- .env
ports:
- 8892:8892
networks:
- scooter
depends_on:
- scooter-favorite-rpc
- gorse
restart: unless-stopped
#comment_api
scooter-comment-api:
build:
context: ./backend
dockerfile: deployments/comment_api.Dockerfile
container_name: scooter-comment-api
env_file:
- .env
ports:
- 8894:8894
networks:
- scooter
depends_on:
- scooter-favorite-rpc
- gorse
restart: unless-stopped
#feed_api
scooter-feed-api:
build:
context: ./backend
dockerfile: deployments/feed_api.Dockerfile
container_name: scooter-feed-api
env_file:
- .env
ports:
- 8891:8891
networks:
- scooter
depends_on:
- scooter-feed-rpc
restart: unless-stopped
#mq_api
scooter-mq-api:
build:
context: ./backend
dockerfile: deployments/mq_api.Dockerfile
container_name: scooter-mq-api
env_file:
- .env
ports:
- 8895:8895
networks:
- scooter
depends_on:
- scooter-feed-rpc
- kafka
- scooter-comment-rpc
- scooter-label-rpc
- gorse
restart: unless-stopped
scooter-nginx:
build:
context: ./scripts/nginx
args:
- BASE_URL=${BASE_URL}
container_name: scooter-nginx
ports:
- 7070:7070
env_file:
- .env
networks:
- scooter
scooter-ml:
build:
context: ML/
env_file:
- .env
container_name: scooter-ml
ports:
- 8000:8000
networks:
- scooter
grafana:
image: grafana/grafana-oss:10.2.0
container_name: scooter-grafana
ports:
- 3000:3000
volumes:
- ./scripts/grafana/grafana.ini:/etc/grafana/grafana.ini
networks:
- scooter
restart: unless-stopped
prometheus:
image: prom/prometheus:v2.47.2
container_name: scooter-prometheus
ports:
- 9090:9090
volumes:
- ./scripts/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
networks:
- scooter
restart: unless-stopped
elasticsearch:
image: elasticsearch:8.10.4
container_name: scooter-elasticsearch
environment:
discovery.type: single-node
networks:
- scooter
restart: unless-stopped
consul:
image: consul:1.15
container_name: scooter-consul
ports:
- 8500:8500
networks:
- scooter
restart: unless-stopped
mysql:
image: mysql:8
container_name: scooter-mysql
# ports:
# - 3306:3306
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --default-time_zone='+8:00'
volumes:
- ./backend/sql/qiniu.sql:/docker-entrypoint-initdb.d/qiniu.sql
environment:
MYSQL_ROOT_PASSWORD: scooter
MYSQL_DATABASE: scooter
TZ: Asia/Shangha
networks:
- scooter
restart: unless-stopped
gorse:
image: zhenghaoz/gorse-in-one:0.4.14
container_name: scooter-gorse
restart: unless-stopped
# ports:
# - 8086:8086 # gRPC port
# - 8088:8088 # HTTP port
environment:
# Use Redis as cache storage backend.
GORSE_CACHE_STORE: redis://scooter-redis:6379
# Use MySQL as data storage backend.
GORSE_DATA_STORE: mysql://root:scooter@tcp(scooter-mysql-gorse:3306)/gorse?parseTime=true
command: >
-c /etc/gorse/config.toml
--log-path /var/log/gorse/master.log
--cache-path /var/lib/gorse/master_cache.data
volumes:
# Mount the configuration file.
- ./scripts/gorse/config.toml:/etc/gorse/config.toml
networks:
- scooter
depends_on:
- mysql-gorse
- redis
mysql-gorse:
image: mysql:8
container_name: scooter-mysql-gorse
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --default-time_zone='+8:00'
environment:
MYSQL_ROOT_PASSWORD: scooter
MYSQL_DATABASE: gorse
TZ: Asia/Shangha
networks:
- scooter
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: scooter-redis
# ports:
# - 6379:6379
networks:
- scooter
restart: unless-stopped
kafka:
image: bitnami/kafka:3.3.1
container_name: scooter-kafka
# ports:
# - 9092:9092
# - 9093:9093
# - 9094:9094
environment:
- KAFKA_ENABLE_KRAFT=yes
- KAFKA_CFG_PROCESS_ROLES=broker,controller
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://scooter-kafka:9092
- KAFKA_CFG_BROKER_ID=1
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=1@kafka:9093
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_KRAFT_CLUSTER_ID=r4zt_wrqTRuT7W2NJsB_GA
kafka-ui:
container_name: kafka-ui
image: provectuslabs/kafka-ui:latest
ports:
- "8080:8080"
environment:
- KAFKA_CLUSTERS_0_BOOTSTRAP_SERVERS=scooter-kafka:9092
- KAFKA_CLUSTERS_0_NAME=r4zt_wrqTRuT7W2NJsB_GA
depends_on:
- kafka
networks:
scooter:
driver: bridge
volumes:
scooter: