-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
686 lines (653 loc) · 17.9 KB
/
docker-compose.yaml
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
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
############################################### Setup #######################################################
version: '3.8'
volumes:
RedisDB: { }
Nginx: { }
RabbitmqLog: { }
RabbitmqLib: { }
ElasticConfig: { }
ElasticData: { }
ElasticData1: { }
ElasticData2: { }
Kibana: { }
Logstash: { }
Filebeat: { }
FilebeatData: { }
Prometheus: { }
PrometheusData: { }
AlertManager: { }
Syslog: { }
Loki: { }
LokiData: { }
Promtail: { }
GrafanaData: { }
GrafanaConfig: { }
ConsulConfig: { }
ConsulData: { }
Vault: { }
networks:
dio:
driver: bridge
services:
################################################ Hercules #######################################################
hercules:
build:
context: .
dockerfile: ./apps/hercules/Dockerfile
target: development
command:
[
'sh',
'-c',
'pnpm prisma generate --schema="./apps/hercules/prisma/schema.prisma" && pnpm prisma migrate dev --schema="./apps/hercules/prisma/schema.prisma" && pnpm start hercules',
]
env_file: ./apps/hercules/.env
container_name: hercules
volumes:
- ./apps/hercules:/usr/share/app/apps/hercules
- ./libs:/usr/share/app/libs
- /usr/share/app/node_modules
expose:
- 4000
networks:
- dio
restart: unless-stopped
depends_on:
- rabbitmq
- hercules-db
- redis
- nginx
labels:
org.label-schema.group: 'Backend'
hercules-db:
image: postgres:14-alpine
container_name: hercules-db
ports:
- "5433:5432"
networks:
- dio
environment:
POSTGRES_USER: ares
POSTGRES_PASSWORD: 7142
POSTGRES_DB: hercules
redis:
image: redis:alpine
container_name: redis
expose:
- 6379
volumes:
- RedisDB:/data
networks:
dio:
labels:
org.label-schema.group: 'Api'
################################################ Apollo #######################################################
apollo:
build:
context: .
dockerfile: ./apps/apollo/Dockerfile
target: development
# args:
# - ${APOLLO_DATABASE_URL}
command:
[
'sh',
'-c',
'pnpm prisma generate --schema="./apps/apollo/prisma/schema.prisma" && pnpm prisma migrate dev --schema="./apps/apollo/prisma/schema.prisma" && pnpm run start apollo',
]
env_file: ./apps/apollo/.env
container_name: apollo
expose:
- 4001
networks:
- dio
restart: unless-stopped
labels:
org.label-schema.group: 'Apollo'
volumes:
- ./apps/apollo:/usr/share/app/apps/apollo
- ./libs:/usr/share/app/libs
- /usr/share/app/node_modules
depends_on:
- apollo-db
- rabbitmq
- nginx
apollo-db:
image: postgres:14-alpine
container_name: apollo-db
ports:
- "5434:5432"
networks:
- dio
environment:
POSTGRES_USER: ares
POSTGRES_PASSWORD: 7142
POSTGRES_DB: apollo
################################################ Coeus #######################################################
coeus:
build:
context: .
dockerfile: ./apps/coeus/Dockerfile
target: development
command: [ 'sh', '-c', 'pnpm run start coeus' ]
env_file: ./apps/coeus/.env
container_name: coeus
expose:
- 4002
networks:
- dio
restart: unless-stopped
labels:
org.label-schema.group: 'Coeus'
volumes:
- ./apps/coeus:/usr/share/app/apps/coeus
- ./libs:/usr/share/app/libs
- /usr/share/app/node_modules
depends_on:
- rabbitmq
- zeus
############################################## Athena ########################################################
athena:
build:
context: ./athena
dockerfile: Dockerfile
container_name: athena
expose:
- 4003
networks:
dio:
restart: unless-stopped
labels:
org.label-schema.group: 'Athena'
############################################## Hesita ########################################################
hesita:
build:
context: .
dockerfile: ./apps/hesita/Dockerfile
target: development
command: [ 'sh', '-c', 'pnpm run start hesita' ]
env_file: ./apps/hesita/.env
container_name: hesita
expose:
- 4004
networks:
- dio
restart: unless-stopped
labels:
org.label-schema.group: 'Hesita'
volumes:
- ./apps/hesita:/usr/share/app/apps/hesita
- ./libs:/usr/share/app/libs
- /usr/share/app/node_modules
depends_on:
- rabbitmq
############################################## Elastic ########################################################
zeus:
build:
context: ./elk/elasticsearch
dockerfile: Dockerfile
args:
ELK_VERSION: ${ELK_VERSION}
container_name: zeus
restart: unless-stopped
environment:
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
ELASTIC_CLUSTER_NAME: ${ELASTIC_CLUSTER_NAME}
ELASTIC_NODE_NAME: ${ELASTIC_NODE_NAME}
ELASTIC_INIT_MASTER_NODE: ${ELASTIC_INIT_MASTER_NODE}
ELASTIC_DISCOVERY_SEEDS: ${ELASTIC_DISCOVERY_SEEDS}
ES_JAVA_OPTS: '-Xmx${ELASTICSEARCH_HEAP} -Xms${ELASTICSEARCH_HEAP} -Des.enforce.bootstrap.checks=true -Dlog4j2.formatMsgNoLookups=true'
bootstrap.memory_lock: 'true'
volumes:
- ElasticData:/usr/share/elasticsearch/data
- ElasticConfig:/usr/share/elasticsearch/config
ports:
- '9200:9200'
- '9300:9300'
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 100000
hard: 100000
networks:
- dio
# healthcheck:
# test:
# [
# 'CMD',
# 'sh',
# '-c',
# "curl -sf --insecure https://$ELASTIC_USERNAME:$ELASTIC_PASSWORD@localhost:9200/_cat/health | grep -ioE 'green|yellow' || echo 'not green/yellow cluster status'",
# ]
elasticsearch_poseidon:
build:
context: ./elk/elasticsearch
dockerfile: Dockerfile
args:
ELK_VERSION: ${ELK_VERSION}
container_name: elasticsearch_poseidon
restart: unless-stopped
environment:
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
ELASTIC_CLUSTER_NAME: ${ELASTIC_CLUSTER_NAME}
ELASTIC_NODE_NAME: ${ELASTIC_NODE_NAME_1}
ELASTIC_INIT_MASTER_NODE: ${ELASTIC_INIT_MASTER_NODE}
ELASTIC_DISCOVERY_SEEDS: ${ELASTIC_DISCOVERY_SEEDS}
ES_JAVA_OPTS: "-Xmx${ELASTICSEARCH_HEAP} -Xms${ELASTICSEARCH_HEAP} -Des.enforce.bootstrap.checks=true -Dlog4j2.formatMsgNoLookups=true"
bootstrap.memory_lock: "true"
volumes:
- ElasticData1:/usr/share/elasticsearch/data
- ElasticConfig:/usr/share/elasticsearch/config
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 200000
hard: 200000
networks:
- dio
# healthcheck:
# test: ["CMD", "sh", "-c", "curl -sf --insecure https://$ELASTIC_USERNAME:$ELASTIC_PASSWORD@localhost:9200/_cat/health | grep -ioE 'green|yellow' || echo 'not green/yellow cluster status'"]
elasticsearch_hades:
build:
context: ./elk/elasticsearch
dockerfile: Dockerfile
args:
ELK_VERSION: ${ELK_VERSION}
container_name: elasticsearch_hades
restart: unless-stopped
environment:
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
ELASTIC_CLUSTER_NAME: ${ELASTIC_CLUSTER_NAME}
ELASTIC_NODE_NAME: ${ELASTIC_NODE_NAME_1}
ELASTIC_INIT_MASTER_NODE: ${ELASTIC_INIT_MASTER_NODE}
ELASTIC_DISCOVERY_SEEDS: ${ELASTIC_DISCOVERY_SEEDS}
ES_JAVA_OPTS: "-Xmx${ELASTICSEARCH_HEAP} -Xms${ELASTICSEARCH_HEAP} -Des.enforce.bootstrap.checks=true -Dlog4j2.formatMsgNoLookups=true"
bootstrap.memory_lock: "true"
volumes:
- ElasticData2:/usr/share/elasticsearch/data
- ElasticConfig:/usr/share/elasticsearch/config
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 200000
hard: 200000
networks:
- dio
# healthcheck:
# test: ["CMD", "sh", "-c", "curl -sf --insecure https://$ELASTIC_USERNAME:$ELASTIC_PASSWORD@localhost:9200/_cat/health | grep -ioE 'green|yellow' || echo 'not green/yellow cluster status'"]
kibana:
build:
context: ./elk/kibana
args:
ELK_VERSION: $ELK_VERSION
container_name: kibana
restart: unless-stopped
volumes:
- Kibana:/usr/share/kibana
environment:
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
ELASTICSEARCH_HOST_PORT: https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}
expose:
- 5601
networks:
- dio
logstash:
build:
context: ./elk/logstash
args:
ELK_VERSION: $ELK_VERSION
container_name: logstash
restart: unless-stopped
volumes:
- Logstash:/usr/share/logstash
environment:
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
ELASTICSEARCH_HOST_PORT: https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}
LS_JAVA_OPTS: "-Xmx${LOGSTASH_HEAP} -Xms${LOGSTASH_HEAP} -Dlog4j2.formatMsgNoLookups=true"
ports:
- "5044:5044"
- "9600:9600"
networks:
- dio
# healthcheck:
# test: ["CMD", "sh", "-c", "curl -sf --insecure https://$ELASTIC_USERNAME:$ELASTIC_PASSWORD@localhost:9200/_cat/health | grep -ioE 'green|yellow' || echo 'not green/yellow cluster status'"]
filebeat:
build:
context: ./elk/filebeat
args:
ELK_VERSION: $ELK_VERSION
restart: always
command: -e --strict.perms=false
user: root
container_name: filebeat
environment:
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
KIBANA_HOST_PORT: ${KIBANA_HOST}:${KIBANA_PORT}
ELASTICSEARCH_HOST_PORT: https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}
expose:
- 5066
volumes:
- Filebeat:/usr/share/filebeat
- FilebeatData:/var/lib/filebeat/data
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- /var/run/docker.sock:/var/run/docker.sock:ro⏎
networks:
- dio
rubban:
image: sherifabdlnaby/rubban:latest
restart: unless-stopped
container_name: rubban
environment:
RUBBAN_KIBANA_HOST: "https://${KIBANA_HOST}:${KIBANA_PORT}"
RUBBAN_KIBANA_USER: ${ELASTIC_USERNAME}
RUBBAN_KIBANA_PASSWORD: ${ELASTIC_PASSWORD}
RUBBAN_REFRESHINDEXPATTERN_ENABLED: "true"
RUBBAN_REFRESHINDEXPATTERN_SCHEDULE: "*/5 * * * *"
RUBBAN_REFRESHINDEXPATTERN_PATTERNS: "*"
RUBBAN_AUTOINDEXPATTERN_ENABLED: "true"
RUBBAN_AUTOINDEXPATTERN_SCHEDULE: "*/5 * * * *"
RUBBAN_AUTOINDEXPATTERN_GENERALPATTERNS: '[{"pattern":"filebeat?","timeFieldName":"@timestamp"},{"pattern":"logstash?","timeFieldName":"@timestamp"}]'
elasticsearch-exporter:
container_name: elasticsearch_exporter
image: justwatch/elasticsearch_exporter:1.1.0
restart: always
command:
[
"--es.uri",
"https://${ELASTIC_USERNAME}:${ELASTIC_PASSWORD}@${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}",
"--es.ssl-skip-verify",
"--es.all",
"--es.snapshots",
"--es.indices",
]
ports:
- "9114:9114"
logstash-exporter:
image: alxrem/prometheus-logstash-exporter:0.7.0
container_name: logstash_exporter
restart: always
ports:
- "9304:9304"
command: [ "-logstash.host", "logstash" ]
networks:
- dio
############################################ Monitoring #######################################################
### v9.0.2
grafana:
build:
context: ./monitoring/grafana
dockerfile: Dockerfile
container_name: grafana
volumes:
- GrafanaData:/var/lib/grafana
- GrafanaConfig:/etc/grafana
environment:
- GF_SECURITY_ADMIN_USER=${ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
restart: unless-stopped
expose:
- 3000
networks:
- dio
labels:
org.label-schema.group: 'Visualization'
### v2.36.2
prometheus:
build:
context: ./monitoring/prometheus
dockerfile: Dockerfile
container_name: prometheus
expose:
- 9090
networks:
- dio
volumes:
- Prometheus:/etc/prometheus
- PrometheusData:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
restart: unless-stopped
labels:
org.label-schema.group: 'monitoring'
### v0.24.0
alertmanager:
build:
context: ./monitoring/alertmanager
dockerfile: Dockerfile
container_name: alertmanager
volumes:
- AlertManager:/etc/alertmanager
command:
- '--config.file=/etc/alertmanager/config.yml'
- '--storage.path=/alertmanager'
restart: unless-stopped
expose:
- 9093
networks:
- dio
labels:
org.label-schema.group: 'monitoring'
### v0.44.0
cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.44.0
container_name: cadvisor
privileged: true
devices:
- /dev/kmsg:/dev/kmsg
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
restart: unless-stopped
expose:
- 8080
networks:
- dio
labels:
org.label-schema.group: 'monitoring'
### v1.4.3
pushgateway:
image: prom/pushgateway:v1.4.3
container_name: pushgateway
restart: unless-stopped
expose:
- 9091
networks:
- dio
labels:
org.label-schema.group: 'monitoring'
### v1.3.1
nodeexporter:
image: prom/node-exporter:v1.3.1
container_name: nodeexporter
user: root
privileged: true
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
restart: unless-stopped
expose:
- 9100
networks:
- dio
labels:
org.label-schema.group: 'monitoring'
### 0.10
nginxexporter:
image: nginx/nginx-prometheus-exporter:0.10
container_name: nginx-exporter
expose:
- 9113
command:
- -nginx.scrape-uri
- http://nginx:8081/stub_status
restart: unless-stopped
networks:
- dio
labels:
org.label-schema.group: 'monitoring'
################################################## Logging ######################################################
### v2.5.0
loki:
build:
context: ./monitoring/loki
dockerfile: Dockerfile
container_name: loki
privileged: true
user: root
volumes:
- Loki:/etc/loki
- LokiData:/tmp/loki
command: -config.file=/etc/loki/loki-config.yml
restart: always
expose:
- 3100
networks:
dio:
labels:
org.label-schema.group: 'logging'
### v2.5.0
promtail:
build:
context: ./monitoring/promtail
dockerfile: Dockerfile
user: root
privileged: true
container_name: promtail
command: -config.file=/etc/promtail/promtail-config.yml
volumes:
- Promtail:/etc/promtail
- /var/log:/var/log
- /var/lib/docker/containers:/var/lib/docker/containers
expose:
- 9080
- 1514
networks:
dio:
restart: unless-stopped
labels:
org.label-schema.group: 'logging'
# v3.30.1
syslog-ng:
build:
context: ./monitoring/syslog
dockerfile: Dockerfile
container_name: syslog-ng
user: root
privileged: true
volumes:
- Syslog:/etc/syslog-ng
- /var/log:/var/log
networks:
dio:
ports:
- protocol: udp
published: 514
target: 514
- protocol: tcp
published: 601
target: 601
restart: always
labels:
org.label-schema.group: 'logging'
################################################# System ########################################################
### v1.23.0-alpine
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
container_name: nginx
ports:
- '2000:443'
- '3000:3000'
- '5601:5601'
- '8081:8081'
- '15672:15672'
volumes:
# - Nginx:/etc/nginx
- ./nginx:/etc/nginx
networks:
- dio
restart: unless-stopped
labels:
org.label-schema.group: 'System'
rabbitmq:
image: rabbitmq:3.9.22-management-alpine
container_name: rabbitmq
expose:
- 5672
- 15672
volumes:
- RabbitmqLib:/var/lib/rabbitmq/
- RabbitmqLog:/var/log/rabbitmq
networks:
- dio
labels:
org.label-schema.group: 'System'
### v1.5.0
vault:
build:
context: ./secrets/vault
dockerfile: Dockerfile
container_name: vault
ports:
- "8200:8200"
volumes:
- Vault:/vault
environment:
- VAULT_ADDR=http://127.0.0.1:8200
command: server
cap_add:
- IPC_LOCK
depends_on:
- consul
networks:
- dio
labels:
org.label-schema.group: "System"
### v1.8.2
consul:
build:
context: ./secrets/consul
dockerfile: Dockerfile
container_name: consul
ports:
- "8500:8500"
environment:
- CONSUL_BIND_INTERFACE=eth0
- CONSUL_CLIENT_INTERFACE=eth0
- CONSUL_ALLOW_PRIVILEGED_PORTS=
command: agent -server -bootstrap-expect 1
volumes:
- ConsulConfig:/consul/config
- ConsulData:/consul/data
networks:
- dio
labels:
org.label-schema.group: "System"
################################################################################################################