-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
451 lines (425 loc) · 12 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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
version: '3.8'
services:
## WEATHER INFO SERVICE
weather:
build: ./service-weather
image: boxb/weather
restart: unless-stopped
container_name: weather
environment:
# - PORT=3000
- PORT=80
- MISSION_HOST=mission
# - MISSION_PORT=3002
- MISSION_PORT=80
volumes:
- ./service-weather/src/:/app/src/ # FOR HOT RELOAD ONLY
depends_on:
- mongo
- kafka-service
expose:
- 80
labels:
- "traefik.http.routers.weather.rule=PathPrefix(`/weather`)"
## ROCKET HQ
rocket:
build: ./service-rocket
image: boxb/rocket
restart: unless-stopped
container_name: rocket
environment:
- PORT=80
- MISSION_HOST=mission
- MISSION_PORT=80
- MONGO_HOST=mongo
- MONGO_PORT=27017
- MONGO_DB=blue_origin
- MODULES=1,1,booster,1,2,middle,1,3,payload,2,1,booster,2,2,middle,2,3,payload
## a 3 size tuple (id of rocket, id of module, name of module)
- MODULES_PORT=80
volumes:
- ./service-rocket/src/:/app/src/ # FOR HOT RELOAD ONLY
depends_on:
- mongo
- kafka-service
expose:
- 80
labels:
- "traefik.http.routers.rocket.rule=PathPrefix(`/rocket`)"
## SEND POOLS & START MISSION
mission:
build: ./service-mission
image: boxb/mission
container_name: mission
restart: unless-stopped
environment:
# - PORT=3002
- PORT=80
- ROCKET_HOST=rocket
# - ROCKET_PORT=3001
- ROCKET_PORT=80
- WEATHER_HOST=weather
# - WEATHER_PORT=3000
- WEATHER_PORT=80
- MONGO_HOST=mongo
- MONGO_PORT=27017
- MONGO_DB=blue_origin
- MODULES_HOST=mission
- MODULES_PORT=80
volumes:
- ./service-mission/src/:/app/src/ # FOR HOT RELOAD ONLY
depends_on:
- mongo
- kafka-service
expose:
- 80
labels:
- "traefik.http.routers.mission.rule=PathPrefix(`/mission`)"
## Webcaster bus subscriber
webcaster:
build: ./service-webcaster
image: boxb/webcaster
container_name: webcaster
restart: unless-stopped
environment:
- PORT=80
volumes:
- ./service-webcaster/src/:/app/src/ # FOR HOT RELOAD ONLY
depends_on:
- mongo
- kafka-service
expose:
- 80
labels:
- "traefik.http.routers.webcaster.rule=PathPrefix(`/webcaster`)"
## DATABASE FOR TELEMETRY, POLLS & ACTIONS HISTORY (WIP)
mongo:
image: mongo:latest
container_name: boxb-mongo
restart: unless-stopped
environment:
# MONGO_INITDB_ROOT_USERNAME: root
# MONGO_INITDB_ROOT_PASSWORD: toor
- MONGODB_DATABASE="blue_origin"
expose:
- 27017
# ports:
# - 27017:27017
## kafka bus configuration
zookeeper:
container_name: boxb-zookeeper
restart: unless-stopped
image: wurstmeister/zookeeper
environment:
zk_id: "1"
expose:
- 2181
kafka-service:
container_name: boxb-kafka
restart: unless-stopped
image: wurstmeister/kafka
depends_on:
- zookeeper
environment:
KAFKA_ADVERTISED_HOST_NAME: kafka-service
KAFKA_ADVERTISED_PORT: 9092
KAFKA_ZOOKEEPER_CONNECT: boxb-zookeeper:2181
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_BROKER_ID: 1
KAFKA_CREATE_TOPICS: "topic-poll:1:1,topic-poll-response:1:1,topic-rocket-event:1:1,topic-launch-event:1:1,topic-launch-order:1:1"
expose:
- 9092
## PROMETHEUS SERVER FOR RETRIEVING DATA FROM ROCKET MODULES
prometheus:
image: prom/prometheus:latest
container_name: boxb-prometheus
restart: unless-stopped
volumes:
- prometheus-data:/prometheus
- ./service-rocket-monitoring/prometheus/:/etc/prometheus/
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=365d'
labels:
- "traefik.http.routers.prometheus.rule=Host(`prometheus.localhost`)"
links:
- alertmanager:alertmanager
ports:
- 9090:9090
expose:
- 9090
# ALERTMANAGER FOR PROMETHEUS
alertmanager:
image: prom/alertmanager:latest
container_name: alertmanager
# deploy:
# replicas: 1
labels:
- "traefik.http.routers.alertmanager.rule=Host(`alertmanager.localhost`)"
volumes:
- ./alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml
#- ./alertmanager/templates/default.tmpl:/etc/alertmanager/templates/default.tmpl
command:
- '--config.file=/etc/alertmanager/alertmanager.yml'
- '--storage.path=/alertmanager'
expose:
- 9093
## GRAFANA DASHBOARD UI FOR PROMETHEUS METRICS
grafana:
image: grafana/grafana
container_name: grafana
restart: unless-stopped
environment:
- GF_PATHS_CONFIG=/etc/grafana/grafana.ini
- GF_INSTALL_PLUGINS=grafana-worldmap-panel,pr0ps-trackmap-panel,camptocamp-prometheus-alertmanager-datasource
depends_on:
- prometheus
volumes:
- grafana-data:/var/lib/grafana
- ./service-rocket-monitoring/grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml
- ./service-rocket-monitoring/grafana/dashboards.yml:/etc/grafana/provisioning/dashboards/dashboards.yml
- ./service-rocket-monitoring/grafana/grafana.ini:/etc/grafana/grafana.ini
- ./service-rocket-monitoring/grafana/dashboards:/var/lib/grafana/dashboards
labels:
- "traefik.http.routers.grafana.rule=Host(`grafana.localhost`)"
expose:
- 3000
## REVERSE PROXY
traefik:
image: traefik:v2.3
container_name: boxb-traefik
restart: unless-stopped
# Enables the web UI and tells Traefik to listen to docker
command:
- "--api.insecure=true"
- "--providers.docker"
depends_on:
- rocket
- mission
- weather
- webcaster
- module-actions-booster-1
- module-actions-booster-2
- module-actions-middle-1
- module-actions-middle-2
- module-actions-payload-1
- module-actions-payload-2
- module-metrics-booster-1
- module-metrics-booster-2
- module-metrics-middle-1
- module-metrics-middle-2
- module-metrics-payload-1
- module-metrics-payload-2
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
ports:
# The HTTP port
- "80:80"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
## MODULES
## first number is rocket id, second number is module id
module-metrics-booster-1:
build: ./service-modules/service-module-metrics
image: boxb/module-metrics
restart: unless-stopped
container_name: module-metrics-booster-1
environment:
- PORT=80
- ID_MODULE=1
- ROCKET_ID=1
- MODULE_TYPE=booster
volumes:
- module-metrics-booster-1:/etc/module-logs/ # FOR ANALOG MODULE STATUS ONLY
expose:
- "80"
module-metrics-middle-1:
build: ./service-modules/service-module-metrics
image: boxb/module-metrics
restart: unless-stopped
container_name: module-metrics-middle-1
environment:
- PORT=80
- ID_MODULE=2
- ROCKET_ID=1
- MODULE_TYPE=middle
volumes:
- module-metrics-middle-1:/etc/module-logs/ # FOR ANALOG MODULE STATUS ONLY
expose:
- "80"
# TODO Traefik LB + PrefixPath by ID
module-metrics-payload-1:
build: ./service-modules/service-module-metrics
image: boxb/module-metrics
restart: unless-stopped
container_name: module-metrics-payload-1
environment:
- PORT=80
- ID_MODULE=3
- ROCKET_ID=1
- MODULE_TYPE=payload
volumes:
- module-metrics-payload-1:/etc/module-logs/ # FOR ANALOG MODULE STATUS ONLY
expose:
- "80"
# TODO Traefik LB + PrefixPath by ID
module-actions-booster-1:
build: ./service-modules/service-module-actions
image: boxb/module-actions
restart: on-failure
container_name: module-actions-booster-1
environment:
- PORT=80
- ID_MODULE=1
- ROCKET_ID=1
- MODULE_TYPE=booster
volumes:
- module-metrics-booster-1:/etc/module-logs/ # FOR ANALOG MODULE DEBUG ONLY
expose:
- "80"
depends_on:
- kafka-service
- mission
# TODO Traefik LB + PrefixPath by ID
module-actions-middle-1:
build: ./service-modules/service-module-actions
image: boxb/module-actions
restart: on-failure
container_name: module-actions-middle-1
environment:
- PORT=80
- MODULE_TYPE=middle
- ROCKET_ID=1
- ID_MODULE=2
volumes:
- module-metrics-middle-1:/etc/module-logs/ # FOR ANALOG MODULE DEBUG ONLY
expose:
- "80"
depends_on:
- kafka-service
- mission
module-actions-payload-1:
build: ./service-modules/service-module-actions
image: boxb/module-actions
restart: on-failure
container_name: module-actions-payload-1
environment:
- PORT=80
- ID_MODULE=3
- ROCKET_ID=1
- MODULE_TYPE=payload
volumes:
- module-metrics-payload-1:/etc/module-logs/ # FOR ANALOG MODULE DEBUG ONLY
expose:
- "80"
depends_on:
- kafka-service
- mission
## second rocket
module-metrics-booster-2:
build: ./service-modules/service-module-metrics
image: boxb/module-metrics
restart: unless-stopped
container_name: module-metrics-booster-2
environment:
- PORT=80
- ID_MODULE=1
- ROCKET_ID=2
- MODULE_TYPE=booster
volumes:
- module-metrics-booster-2:/etc/module-logs/ # FOR ANALOG MODULE STATUS ONLY
expose:
- "80"
module-metrics-middle-2:
build: ./service-modules/service-module-metrics
image: boxb/module-metrics
restart: unless-stopped
container_name: module-metrics-middle-2
environment:
- PORT=80
- ID_MODULE=2
- ROCKET_ID=2
- MODULE_TYPE=middle
volumes:
- module-metrics-middle-2:/etc/module-logs/ # FOR ANALOG MODULE STATUS ONLY
expose:
- "80"
# TODO Traefik LB + PrefixPath by ID
module-metrics-payload-2:
build: ./service-modules/service-module-metrics
image: boxb/module-metrics
restart: unless-stopped
container_name: module-metrics-payload-2
environment:
- PORT=80
- ID_MODULE=3
- ROCKET_ID=2
- MODULE_TYPE=payload
volumes:
- module-metrics-payload-2:/etc/module-logs/ # FOR ANALOG MODULE STATUS ONLY
expose:
- "80"
# TODO Traefik LB + PrefixPath by ID
module-actions-booster-2:
build: ./service-modules/service-module-actions
image: boxb/module-actions
restart: on-failure
container_name: module-actions-booster-2
environment:
- PORT=80
- ID_MODULE=1
- ROCKET_ID=2
- MODULE_TYPE=booster
volumes:
- module-metrics-booster-2:/etc/module-logs/ # FOR ANALOG MODULE DEBUG ONLY
expose:
- "80"
depends_on:
- kafka-service
- mission
# TODO Traefik LB + PrefixPath by ID
module-actions-middle-2:
build: ./service-modules/service-module-actions
image: boxb/module-actions
restart: on-failure
container_name: module-actions-middle-2
environment:
- PORT=80
- MODULE_TYPE=middle
- ROCKET_ID=2
- ID_MODULE=2
volumes:
- module-metrics-middle-2:/etc/module-logs/ # FOR ANALOG MODULE DEBUG ONLY
expose:
- "80"
depends_on:
- kafka-service
- mission
module-actions-payload-2:
build: ./service-modules/service-module-actions
image: boxb/module-actions
restart: on-failure
container_name: module-actions-payload-2
environment:
- PORT=80
- ID_MODULE=3
- ROCKET_ID=2
- MODULE_TYPE=payload
volumes:
- module-metrics-payload-2:/etc/module-logs/ # FOR ANALOG MODULE DEBUG ONLY
expose:
- "80"
depends_on:
- kafka-service
- mission
volumes:
prometheus-data: { }
grafana-data: { }
module-metrics-booster-1: { }
module-metrics-middle-1: { }
module-metrics-payload-1: { }
module-metrics-booster-2: { }
module-metrics-middle-2: { }
module-metrics-payload-2: { }