-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
866 lines (816 loc) · 20.6 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
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
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
networks:
aegis guard: {}
atlas:
internal: true
sentinel:
internal: true
internet_access:
internal: false
alfred_network:
internal: true
mnemosine_network:
internal: true
petrus_network:
internal: true
volumes:
shared_code:
driver: local
driver_opts:
type: none
device: ./requirements/shared_code
o: bind
certificates: {}
elastic_data: {}
kibana_data: {}
logstash_data: {}
filebeat_data: {}
alfred_data: {}
mnemosine_data: {}
petrus_data: {}
vault_data: {}
token_alfred_data: {}
token_alfred_db_data: {}
token_shared_data: {}
token_davinci_data: {}
token_db_exporter_data: {}
token_mnemosine_data: {}
token_mnemosine_db_data: {}
token_petrus_data: {}
token_petrus_db_data: {}
token_root_data: {}
token_env_data: {}
token_alertmanager_data: {}
services:
# # Reverse proxy container
aegis:
container_name: aegis
depends_on:
alfred:
condition: service_healthy
aether:
condition: service_healthy
apollo:
condition: service_healthy
coubertin:
condition: service_healthy
cupidon:
condition: service_healthy
davinci:
condition: service_started
hermes:
condition: service_healthy
iris:
condition: service_healthy
ludo:
condition: service_healthy
malevitch:
condition: service_started
mensura:
condition: service_started
mnemosine:
condition: service_healthy
petrus:
condition: service_healthy
tutum:
condition: service_healthy
build:
context: ./requirements/aegis
dockerfile: Dockerfile
args:
PROXY_CONF: $PROXY_CONF
env_file: .env
ports:
- "80:80"
- "443:443"
- "7999:80"
- "8000:443"
volumes:
- ./requirements/aegis:/usr/share/nginx/html
- /etc/letsencrypt/archive/batch42.me:/etc/letsencrypt/live/batch42.me:r
networks:
- aegis guard
- atlas
- sentinel
restart: on-failure
# Nginx exporter container
aegis_vts_exporter:
depends_on:
aegis:
condition: service_started
container_name: aegis_vts_exporter
build:
context: ./requirements/mensura/aegis_vts_exporter
dockerfile: Dockerfile
ports:
- "9913:9913"
networks:
- atlas
restart: on-failure
# # Logstash container
aether:
depends_on:
apollo:
condition: service_healthy
iris:
condition: service_healthy
policy:
condition: service_healthy
container_name: aether
build:
context: ./requirements/aether
dockerfile: Dockerfile
labels:
co.elastic.logs/module: logstash
user: root
volumes:
- certificates:/usr/share/logstash/config/certs:ro
- logstash_data:/usr/share/logstash/data
environment:
xpack.monitoring.enabled: false
ELASTIC_USER: ${ELASTIC_USER}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
ELASTIC_HOSTS: https://apollo:9200
networks:
- atlas
- sentinel
- internet_access
restart: always
healthcheck:
test:
[
"CMD-SHELL",
"timeout 1 bash -c 'cat < /dev/null > /dev/tcp/127.0.0.1/5140' && \
timeout 1 bash -c 'cat < /dev/null > /dev/tcp/127.0.0.1/5141' && \
timeout 1 bash -c 'cat < /dev/null > /dev/tcp/127.0.0.1/5044' || exit 1",
]
interval: 10s
timeout: 10s
retries: 120
# # Profil container
alfred:
depends_on:
alfred_db:
condition: service_healthy
aether:
condition: service_healthy
container_name: alfred
build:
context: ./requirements/alfred
dockerfile: Dockerfile
volumes:
- ./requirements/alfred/alfred_project:/app
- token_alfred_data:/app/tokens
- shared_code:/app/shared
ports:
- "8001:8001"
networks:
- atlas
- alfred_network
- internet_access
healthcheck:
test:
[
"CMD-SHELL",
"python3",
"/app/shared/curl.py",
"http://localhost:8001/healthcheck/"
]
interval: 5s
timeout: 5s
retries: 5
start_period: 20s
restart: on-failure
# # Profil database container
alfred_db:
depends_on:
tutum:
condition: service_healthy
container_name: alfred_db
build:
context: ./requirements/alfred_db/
dockerfile: Dockerfile
ports:
- "5432:5432"
environment:
POSTGRES_DB: $POSTGRES_ALFRED_DB
POSTGRES_USER: $POSTGRES_ALFRED_USER
POSTGRES_PASSWORD: $POSTGRES_ALFRED_PASSWORD
volumes:
- alfred_data:/var/lib/postgresql/data
- token_alfred_db_data:/tokens
networks:
- alfred_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -d user_management -U alfred"]
interval: 5s
timeout: 5s
retries: 5
# # Elastisearch container
apollo:
depends_on:
setup:
condition: service_healthy
tutum:
condition: service_healthy
container_name: apollo
build:
context: ./requirements/apollo
dockerfile: Dockerfile
labels:
co.elastic.logs/module: elasticsearch
volumes:
- certificates:/usr/share/elasticsearch/config/certs:ro
- elastic_data:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- sentinel
- internet_access
environment:
node.name: elasticsearch
node.attr.rack: r1
indices.lifecycle.poll_interval: 10s
cluster.name: ${CLUSTER_NAME}
discovery.type: single-node
ELASTIC_USER: ${ELASTIC_USER}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
bootstrap.memory_lock: true
network.host: 0.0.0.0
xpack.security.enabled: true
xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.key: certs/apollo/apollo.key
xpack.security.http.ssl.certificate: certs/apollo/apollo.crt
xpack.security.http.ssl.certificate_authorities: certs/ca/ca.crt
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.key: certs/apollo/apollo.key
xpack.security.transport.ssl.certificate: certs/apollo/apollo.crt
xpack.security.transport.ssl.certificate_authorities: certs/ca/ca.crt
xpack.security.transport.ssl.verification_mode: certificate
xpack.license.self_generated.type: ${LICENSE}
ES_JAVA_OPTS: "-Xms1g -Xmx1g"
mem_limit: ${ES_MEM_LIMIT}
ulimits:
memlock:
soft: -1
hard: -1
restart: always
healthcheck:
test:
[
"CMD-SHELL",
"curl --cacert config/certs/ca/ca.crt https://localhost:9200 | grep -q 'missing authentication credentials'",
]
interval: 10s
timeout: 10s
retries: 120
# # Tournament container
coubertin:
depends_on:
aether:
condition: service_healthy
tutum:
condition: service_healthy
container_name: coubertin
build:
context: ./requirements/coubertin
dockerfile: Dockerfile
volumes:
- ./requirements/coubertin/coubertin_project:/app
- token_shared_data:/app/tokens
- shared_code:/app/shared
ports:
- "8002:8002"
networks:
- atlas
healthcheck:
test:
[
"CMD-SHELL",
"python3",
"/app/shared/curl.py",
"http://localhost:8002/healthcheck/"
]
restart: on-failure
# # Matchmaking container
cupidon:
depends_on:
aether:
condition: service_healthy
tutum:
condition: service_healthy
container_name: cupidon
build:
context: ./requirements/cupidon
dockerfile: Dockerfile
volumes:
- ./requirements/cupidon/cupidon_project:/app
- token_shared_data:/app/tokens
- shared_code:/app/shared
ports:
- "8003:8003"
networks:
- atlas
healthcheck:
test:
[
"CMD-SHELL",
"python3",
"/app/shared/curl.py",
"http://localhost:8003/healthcheck/"
]
interval: 5s
timeout: 5s
retries: 5
start_period: 20s
restart: on-failure
# # Kibana's Data View container
data_views:
depends_on:
aether:
condition: service_healthy
container_name: data_views
image: docker:19.03-dind
networks:
- sentinel
- internet_access
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
entrypoint: /bin/sh -c "docker exec iris sh -c '/usr/share/kibana/scripts/data_views.sh'"
healthcheck:
test: ["CMD-SHELL", "docker logs data_views | grep -q 'All Data Views creation completed.'"]
interval: 1s
timeout: 5s
retries: 120
restart: on-failure
# # Kibana's Dashboards container
dashboards:
depends_on:
data_views:
condition: service_healthy
container_name: dashboards
image: docker:19.03-dind
networks:
- sentinel
- internet_access
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
entrypoint: /bin/sh -c "docker exec iris sh -c '/usr/share/kibana/scripts/dashboards.sh'"
# # Grafana container
davinci:
container_name: davinci
build:
context: ./requirements/davinci
dockerfile: Dockerfile
volumes:
- token_davinci_data:/tokens
ports:
- "8010:8010"
networks:
- sentinel
depends_on:
tutum:
condition: service_healthy
restart: on-failure
# # Filebeat container
filebeat:
container_name: filebeat
depends_on:
aether:
condition: service_healthy
apollo:
condition: service_healthy
iris:
condition: service_healthy
build:
context: ./requirements/filebeat
dockerfile: Dockerfile
user: root
volumes:
- certificates:/usr/share/filebeat/config/certs:ro
- filebeat_data:/usr/share/filebeat/data
- "/var/lib/docker/containers:/var/lib/docker/containers:ro"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
environment:
- ELASTIC_USER=${ELASTIC_USER}
- ELASTIC_PASSWORD=${ELASTIC_PASSWORD}
- ELASTIC_HOSTS=https://apollo:9200
- KIBANA_HOSTS=http://iris:5601
- LOGSTASH_HOSTS=aether:5044
networks:
- sentinel
- internet_access
- atlas
restart: always
# # Notification container
hermes:
container_name: hermes
build:
context: ./requirements/hermes
dockerfile: Dockerfile
volumes:
- ./requirements/hermes/hermes_project:/app
- token_shared_data:/app/tokens
- shared_code:/app/shared
ports:
- "8004:8004"
networks:
- atlas
depends_on:
tutum:
condition: service_healthy
aether:
condition: service_healthy
healthcheck:
test:
[
"CMD-SHELL",
"python3",
"/app/shared/curl.py",
"http://localhost:8004/healthcheck/"
]
interval: 5s
timeout: 5s
retries: 5
start_period: 20s
restart: on-failure
# # Kibana container
iris:
depends_on:
apollo:
condition: service_healthy
tutum:
condition: service_healthy
container_name: iris
build:
context: ./requirements/iris
dockerfile: Dockerfile
labels:
co.elastic.logs/module: kibana
volumes:
- certificates:/usr/share/kibana/config/certs:ro
- kibana_data:/usr/share/kibana/data
ports:
- 5601:5601
environment:
SERVERNAME: kibana-server
ELASTICSEARCH_HOSTS: https://apollo:9200
ELASTICSEARCH_USERNAME: kibana_system
ELASTICSEARCH_PASSWORD: ${KIBANA_PASSWORD}
ELASTIC_USER: ${ELASTIC_USER}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
ELASTICSEARCH_SSL_CERTIFICATEAUTHORITIES: config/certs/ca/ca.crt
XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY: ${ENCRYPT_KEY}
XPACK_REPORTING_ENCRYPTIONKEY: ${REP_ENCRYPT_KEY}
XPACK_SECURITY_ENCRYPTIONKEY: ${SEC_ENCRYPT_KEY}
SERVER_PUBLICBASEURL: https://localhost:5601
SERVER_SSL_CERTIFICATE: config/certs/kibana-server/kibana-server.crt
SERVER_SSL_KEY: config/certs/kibana-server/kibana-server.key
SERVER_SSL_ENABLED: true
mem_limit: ${KB_MEM_LIMIT}
networks:
- internet_access
- sentinel
healthcheck:
test:
[
"CMD-SHELL",
"curl -k -s -I https://localhost:5601 | grep -q 'HTTP/1.1 302 Found'",
]
interval: 10s
timeout: 10s
retries: 120
restart: always
# # Game container
ludo:
container_name: ludo
build:
context: ./requirements/ludo
dockerfile: Dockerfile
volumes:
- ./requirements/ludo/ludo_project:/app
- shared_code:/app/shared
- token_shared_data:/app/tokens
ports:
- "8006:8006"
networks:
- atlas
depends_on:
tutum:
condition: service_healthy
aether:
condition: service_healthy
healthcheck:
test:
[
"CMD-SHELL",
"python3",
"/app/shared/curl.py",
"http://localhost:8006/healthcheck/"
]
interval: 5s
timeout: 5s
retries: 5
start_period: 20s
restart: on-failure
# # Front container
malevitch:
container_name: malevitch
build:
context: ./requirements/malevitch
dockerfile: Dockerfile
volumes:
- ./requirements/malevitch:/usr/share/nginx/html
ports:
- "8007:80"
networks:
- atlas
restart: on-failure
# # Prometheus container
mensura:
container_name: mensura
build:
context: ./requirements/mensura
dockerfile: Dockerfile
ports:
- "8011:8011"
networks:
- atlas
- sentinel
restart: on-failure
db_exporter_a:
container_name: db_exporter_a
build:
context: ./requirements/mensura/db_exporter_a
dockerfile: Dockerfile
ports:
- "9187:9187"
networks:
- sentinel
- alfred_network
volumes:
- token_db_exporter_data:/tokens
depends_on:
mensura:
condition: service_started
alfred_db:
condition: service_healthy
restart: on-failure
db_exporter_m:
container_name: db_exporter_m
build:
context: ./requirements/mensura/db_exporter_m
dockerfile: Dockerfile
ports:
- "9187:9187"
networks:
- sentinel
- mnemosine_network
volumes:
- token_db_exporter_data:/tokens
depends_on:
mensura:
condition: service_started
mnemosine_db:
condition: service_healthy
restart: on-failure
db_exporter_p:
container_name: db_exporter_p
build:
context: ./requirements/mensura/db_exporter_p
dockerfile: Dockerfile
ports:
- "9187:9187"
networks:
- sentinel
- petrus_network
volumes:
- token_db_exporter_data:/tokens
depends_on:
mensura:
condition: service_started
petrus_db:
condition: service_healthy
restart: on-failure
# # Data exporter container
alertmanager:
container_name: alertmanager
build:
context: ./requirements/mensura/alertmanager
dockerfile: Dockerfile
volumes:
- token_alertmanager_data:/tokens
ports:
- "9093:9093"
depends_on:
mensura:
condition: service_started
aegis:
condition: service_started
networks:
- aegis guard
- sentinel
restart: on-failure
# # Stats container
mnemosine:
container_name: mnemosine
build:
context: ./requirements/mnemosine
dockerfile: Dockerfile
volumes:
- ./requirements/mnemosine/mnemosine_project:/app
- token_mnemosine_data:/app/tokens
- shared_code:/app/shared
ports:
- "8008:8008"
networks:
- atlas
- mnemosine_network
depends_on:
mnemosine_db:
condition: service_healthy
aether:
condition: service_healthy
healthcheck:
test:
[
"CMD-SHELL",
"python3",
"/app/shared/curl.py",
"http://localhost:8008/healthcheck/"
]
interval: 5s
timeout: 5s
retries: 5
start_period: 20s
restart: on-failure
# # Stats database container
mnemosine_db:
depends_on:
tutum:
condition: service_healthy
container_name: mnemosine_db
build:
context: ./requirements/mnemosine_db/
dockerfile: Dockerfile
environment:
POSTGRES_DB: $POSTGRES_MNEMOSINE_DB
POSTGRES_USER: $POSTGRES_MNEMOSINE_USER
POSTGRES_PASSWORD: $POSTGRES_MNEMOSINE_PASSWORD
volumes:
- token_mnemosine_db_data:/tokens
- mnemosine_data:/var/lib/postgresql/data
networks:
- mnemosine_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -d memory_management -U mnemosine"]
interval: 5s
timeout: 5s
retries: 5
# # Authentification container
petrus:
container_name: petrus
build:
context: ./requirements/petrus
dockerfile: Dockerfile
volumes:
- ./requirements/petrus/petrus_project:/app
- shared_code:/app/shared
- token_petrus_data:/app/tokens
ports:
- "8009:8009"
depends_on:
petrus_db:
condition: service_healthy
aether:
condition: service_healthy
networks:
- atlas
- petrus_network
healthcheck:
test:
[
"CMD-SHELL",
"python3",
"/app/shared/curl.py",
"http://localhost:8009/healthcheck/"
]
interval: 5s
timeout: 5s
retries: 5
start_period: 20s
restart: on-failure
# # Authentification database container
petrus_db:
depends_on:
tutum:
condition: service_healthy
container_name: petrus_db
build:
context: ./requirements/petrus_db/
dockerfile: Dockerfile
environment:
POSTGRES_DB: $POSTGRES_PETRUS_DB
POSTGRES_USER: $POSTGRES_PETRUS_USER
POSTGRES_PASSWORD: $POSTGRES_PETRUS_PASSWORD
volumes:
- token_petrus_db_data:/tokens
- petrus_data:/var/lib/postgresql/data
networks:
- petrus_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -d auth_management -U petrus"]
interval: 5s
timeout: 5s
retries: 5
# # Elasticsearch's ILM container
policy:
depends_on:
apollo:
condition: service_healthy
iris:
condition: service_healthy
container_name: policy
image: docker:19.03-dind
networks:
- sentinel
- internet_access
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
entrypoint: /bin/sh -c "docker exec apollo sh -c '/usr/share/elasticsearch/scripts/logs_policy.sh'"
healthcheck:
test: ["CMD-SHELL", "docker logs policy | grep -q 'All ILM policy configurations completed.'"]
interval: 1s
timeout: 5s
retries: 120
restart: on-failure
# # Vault container
tutum:
container_name: tutum
build:
context: ./requirements/tutum
dockerfile: Dockerfile
env_file: .env
volumes:
- vault_data:/opt/vault
- token_alfred_data:/tokens/alfred
- token_alfred_db_data:/tokens/alfred-db
- token_shared_data:/tokens/shared-django
- token_davinci_data:/tokens/davinci
- token_db_exporter_data:/tokens/db_exporter
- token_mnemosine_data:/tokens/mnemosine
- token_mnemosine_db_data:/tokens/mnemosine-db
- token_petrus_data:/tokens/petrus
- token_petrus_db_data:/tokens/petrus-db
- token_root_data:/tokens/root
- token_env_data:/tokens/env
- token_alertmanager_data:/tokens/alertmanager
ports:
- "8200:8200"
networks:
- atlas
- sentinel
- alfred_network
- mnemosine_network
- petrus_network
restart: on-failure
healthcheck:
test: ["CMD", "curl", "-sSf", "http://localhost:8200/v1/sys/health"]
interval: 1s
timeout: 5s
retries: 120
# # Websocket container
redis:
container_name: redis
build:
context: ./requirements/redis
dockerfile: Dockerfile
# image: 'bitnami/redis:latest'
environment:
- ALLOW_EMPTY_PASSWORD=yes
networks:
- atlas
restart: on-failure
# # ELK setup container
setup:
depends_on:
tutum:
condition: service_healthy
container_name: setup
environment:
- "ELASTIC_PASSWORD=${ELASTIC_PASSWORD}"
- "KIBANA_PASSWORD=${KIBANA_PASSWORD}"
build:
context: ./requirements/setup
dockerfile: Dockerfile
volumes:
- certificates:/usr/share/elasticsearch/config/certs
user: "0"
command: bash /usr/share/elasticsearch/tools/setup.sh
networks:
- sentinel
healthcheck:
test: ["CMD-SHELL", "[ -f config/certs/apollo/apollo.crt ]"]
interval: 1s
timeout: 5s
retries: 120
restart: on-failure