-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
1069 lines (1041 loc) · 34.3 KB
/
docker-compose.prod.yml
File metadata and controls
1069 lines (1041 loc) · 34.3 KB
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
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
version: '3.8'
services:
# ===========================================
# API Gateway - Traefik (Official Docker Image)
# ===========================================
# SECURITY: TLS is properly configured with Let's Encrypt ACME
# - HTTP to HTTPS redirect enabled (entrypoints.web.http.redirections)
# - Automatic certificate management via ACME HTTP challenge
# - Certificates stored securely in /letsencrypt/acme.json
# - All backend services use tls.certresolver=letsencrypt
traefik:
image: traefik:v3.0
container_name: grc-traefik
command:
- '--api.dashboard=false'
- '--providers.docker=true'
- '--providers.docker.exposedbydefault=false'
- '--entrypoints.web.address=:80'
- '--entrypoints.websecure.address=:443'
# SECURITY: Force HTTPS by redirecting all HTTP traffic
- '--entrypoints.web.http.redirections.entryPoint.to=websecure'
- '--entrypoints.web.http.redirections.entryPoint.scheme=https'
# SECURITY: Let's Encrypt ACME for automatic TLS certificate management
- '--certificatesresolvers.letsencrypt.acme.httpchallenge=true'
- '--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web'
- '--certificatesresolvers.letsencrypt.acme.email=${ACME_EMAIL}'
- '--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json'
- '--log.level=${TRAEFIK_LOG_LEVEL:-WARN}'
- '--log.format=json'
- '--accesslog=true'
- '--accesslog.format=json'
- '--accesslog.filepath=/var/log/traefik/access.log'
ports:
- '80:80'
- '443:443'
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik_letsencrypt:/letsencrypt
- traefik_logs:/var/log/traefik
networks:
- grc-network
- grc-dmz
restart: always
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
cap_add:
- NET_BIND_SERVICE
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
healthcheck:
test: ['CMD', 'traefik', 'healthcheck', '--ping']
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
# ===========================================
# Database - PostgreSQL (Official Docker Image)
# ===========================================
postgres:
image: postgres:16-alpine
container_name: grc-postgres
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_INITDB_ARGS: '--encoding=UTF8 --locale=en_US.UTF-8'
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- postgres_data:/var/lib/postgresql/data
- postgres_backups:/backups
- ./database/init:/docker-entrypoint-initdb.d:ro
networks:
- grc-network
restart: always
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
cap_add:
- CHOWN
- DAC_OVERRIDE
- FOWNER
- SETGID
- SETUID
read_only: true
tmpfs:
- /tmp
- /run/postgresql
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}']
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
deploy:
resources:
limits:
cpus: '2.0'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
shm_size: 256mb
# ===========================================
# Cache & Message Queue - Redis (Official Docker Image)
# ===========================================
redis:
image: redis:7-alpine
container_name: grc-redis
command: >
redis-server --appendonly yes --requirepass ${REDIS_PASSWORD} --maxmemory ${REDIS_MAX_MEMORY:-512mb} --maxmemory-policy allkeys-lru --save 900 1 --save 300 10 --save 60 10000 --loglevel ${REDIS_LOG_LEVEL:-warning}
volumes:
- redis_data:/data
networks:
- grc-network
restart: always
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
read_only: true
tmpfs:
- /tmp
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
healthcheck:
test: ['CMD', 'redis-cli', '-a', '${REDIS_PASSWORD}', 'ping']
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
# ===========================================
# Authentication - Keycloak (Official Keycloak Image)
# ===========================================
keycloak:
image: quay.io/keycloak/keycloak:25.0
container_name: grc-keycloak
command: start --import-realm
environment:
# Database
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://postgres:5432/${KEYCLOAK_DB:-keycloak}
KC_DB_USERNAME: ${POSTGRES_USER}
KC_DB_PASSWORD: ${POSTGRES_PASSWORD}
KC_DB_POOL_INITIAL_SIZE: ${KC_DB_POOL_INITIAL_SIZE:-5}
KC_DB_POOL_MIN_SIZE: ${KC_DB_POOL_MIN_SIZE:-5}
KC_DB_POOL_MAX_SIZE: ${KC_DB_POOL_MAX_SIZE:-20}
# Hostname — Traefik handles TLS, so Keycloak serves HTTP behind the proxy
KC_HOSTNAME: ${KEYCLOAK_HOSTNAME}
KC_HOSTNAME_STRICT: 'true'
KC_HOSTNAME_STRICT_HTTPS: 'true'
KC_PROXY_HEADERS: xforwarded
# HTTP only — TLS is terminated by Traefik
KC_HTTP_ENABLED: 'true'
# Admin
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD}
# Performance — default ispn cache with udp discovery for Docker Compose
KC_CACHE: ispn
# Logging
KC_LOG_LEVEL: ${KC_LOG_LEVEL:-info}
KC_LOG_CONSOLE_OUTPUT: json
# Features
KC_HEALTH_ENABLED: 'true'
KC_METRICS_ENABLED: 'true'
KC_HTTP_RELATIVE_PATH: /auth
volumes:
- ./auth/realm-export.json:/opt/keycloak/data/import/realm-export.json:ro
- keycloak_data:/opt/keycloak/data
depends_on:
postgres:
condition: service_healthy
networks:
- grc-network
- grc-dmz
labels:
- 'traefik.enable=true'
- 'traefik.docker.network=grc-dmz'
- 'traefik.http.routers.keycloak.rule=Host(`${KEYCLOAK_HOSTNAME}`)'
- 'traefik.http.routers.keycloak.entrypoints=websecure'
- 'traefik.http.routers.keycloak.tls.certresolver=letsencrypt'
- 'traefik.http.services.keycloak.loadbalancer.server.port=8080'
- 'traefik.http.middlewares.keycloak-headers.headers.customrequestheaders.X-Forwarded-Proto=https'
- 'traefik.http.routers.keycloak.middlewares=keycloak-headers'
restart: always
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
healthcheck:
test:
[
'CMD-SHELL',
"exec 3<>/dev/tcp/127.0.0.1/9000 && echo -e 'GET /auth/health/ready HTTP/1.1\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n' >&3 && cat <&3 | grep -q '200 OK'",
]
interval: 30s
timeout: 10s
retries: 5
start_period: 120s
deploy:
resources:
limits:
cpus: '2.0'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
# ===========================================
# Object Storage - RustFS (S3-Compatible, Apache 2.0)
# High-performance Rust-based object storage
# https://github.com/rustfs/rustfs
# Pinned by digest so a compromised upstream `:latest` tag cannot
# silently swap the image at pull time. Reviewers: verify this digest
# matches the RustFS image currently running in production via
# `docker image inspect rustfs/rustfs --format '{{.RepoDigests}}'`.
# ===========================================
rustfs:
image: rustfs/rustfs@sha256:8e467b32af3ff83e70c70dddb0c36b5e611f46e89a3075db8770aea4f30b2fe3
container_name: grc-rustfs
environment:
RUSTFS_ROOT_USER: ${MINIO_ROOT_USER}
RUSTFS_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
RUSTFS_BROWSER: ${MINIO_BROWSER:-on}
RUSTFS_PROMETHEUS_AUTH_TYPE: public
RUSTFS_DOMAIN: ${MINIO_DOMAIN:-storage.${APP_DOMAIN}}
volumes:
- rustfs_data:/data
- rustfs_logs:/logs
networks:
- grc-network
- grc-dmz
labels:
- 'traefik.enable=true'
- 'traefik.docker.network=grc-dmz'
# S3 API
- 'traefik.http.routers.rustfs-api.rule=Host(`storage.${APP_DOMAIN}`)'
- 'traefik.http.routers.rustfs-api.entrypoints=websecure'
- 'traefik.http.routers.rustfs-api.tls.certresolver=letsencrypt'
- 'traefik.http.routers.rustfs-api.service=rustfs-api'
- 'traefik.http.services.rustfs-api.loadbalancer.server.port=9000'
# Console
- 'traefik.http.routers.rustfs-console.rule=Host(`console.storage.${APP_DOMAIN}`)'
- 'traefik.http.routers.rustfs-console.entrypoints=websecure'
- 'traefik.http.routers.rustfs-console.tls.certresolver=letsencrypt'
- 'traefik.http.routers.rustfs-console.service=rustfs-console'
- 'traefik.http.services.rustfs-console.loadbalancer.server.port=9001'
restart: always
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
healthcheck:
test:
['CMD-SHELL', 'wget -q --spider http://localhost:9001/rustfs/console/index.html || exit 1']
interval: 30s
timeout: 20s
retries: 3
start_period: 30s
deploy:
resources:
limits:
cpus: '2.0'
memory: 2G
reservations:
cpus: '0.25'
memory: 256M
# ===========================================
# Secrets Management - Infisical (Optional)
# Only starts with: docker compose --profile infisical up -d
# Set SECRETS_PROVIDER=infisical in .env to use
# ===========================================
infisical:
image: infisical/infisical:v0.158.2
container_name: grc-infisical
profiles:
- infisical
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
read_only: true
tmpfs:
- /tmp
- /etc/ssl/certs
environment:
ENCRYPTION_KEY: ${INFISICAL_ENCRYPTION_KEY}
AUTH_SECRET: ${INFISICAL_AUTH_SECRET}
DB_CONNECTION_URI: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/infisical
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379/1
SITE_URL: https://secrets.${APP_DOMAIN}
TELEMETRY_ENABLED: false
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- grc-network
- grc-dmz
labels:
- 'traefik.enable=true'
- 'traefik.docker.network=grc-dmz'
- 'traefik.http.routers.infisical.rule=Host(`secrets.${APP_DOMAIN}`)'
- 'traefik.http.routers.infisical.entrypoints=websecure'
- 'traefik.http.routers.infisical.tls.certresolver=letsencrypt'
- 'traefik.http.services.infisical.loadbalancer.server.port=8080'
- 'traefik.http.middlewares.infisical-ipallow.ipallowlist.sourcerange=10.0.0.0/8,172.16.0.0/12'
- 'traefik.http.routers.infisical.middlewares=infisical-ipallow'
restart: always
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
healthcheck:
test:
['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:8080/api/status']
interval: 15s
timeout: 10s
retries: 10
start_period: 120s
deploy:
resources:
limits:
cpus: '1'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
# ===========================================
# Controls Service - Security Controls Management
# ===========================================
controls:
build:
context: .
dockerfile: services/controls/Dockerfile
args:
NODE_ENV: production
image: grc-controls:${IMAGE_TAG:-latest}
container_name: grc-controls
environment:
NODE_ENV: production
PORT: 3001
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
S3_ENDPOINT: rustfs
S3_PORT: 9000
S3_USE_SSL: true
S3_ACCESS_KEY: ${MINIO_ROOT_USER}
S3_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
MINIO_ENDPOINT: rustfs
MINIO_PORT: 9000
MINIO_USE_SSL: false
MINIO_ACCESS_KEY: ${MINIO_ROOT_USER}
MINIO_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
KEYCLOAK_URL: http://keycloak:8080/auth
KEYCLOAK_REALM: ${KEYCLOAK_REALM}
JWT_SECRET: ${JWT_SECRET}
LOG_LEVEL: ${LOG_LEVEL:-info}
RATE_LIMIT_ENABLED: ${RATE_LIMIT_ENABLED:-true}
RATE_LIMIT_MAX: ${RATE_LIMIT_MAX:-100}
RATE_LIMIT_WINDOW_MS: ${RATE_LIMIT_WINDOW_MS:-60000}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
keycloak:
condition: service_healthy
rustfs:
condition: service_healthy
networks:
- grc-network
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.controls.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/controls`)'
- 'traefik.http.routers.controls-evidence.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/evidence`)'
- 'traefik.http.routers.controls-workspaces.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/workspaces`)'
- 'traefik.http.routers.controls-workspaces.entrypoints=websecure'
- 'traefik.http.routers.controls-workspaces.tls.certresolver=letsencrypt'
- 'traefik.http.routers.controls-workspaces.middlewares=controls-ratelimit'
# Risk module is in controls service, not frameworks
- 'traefik.http.routers.controls-risks.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/risks`)'
- 'traefik.http.routers.controls-risks.entrypoints=websecure'
- 'traefik.http.routers.controls-risks.tls.certresolver=letsencrypt'
- 'traefik.http.routers.controls-risks.middlewares=controls-ratelimit'
- 'traefik.http.routers.controls-risk-config.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/risk-config`)'
- 'traefik.http.routers.controls-risk-config.entrypoints=websecure'
- 'traefik.http.routers.controls-risk-config.tls.certresolver=letsencrypt'
- 'traefik.http.routers.controls-risk-config.middlewares=controls-ratelimit'
- 'traefik.http.routers.controls-risk-tasks.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/risk-tasks`)'
- 'traefik.http.routers.controls-risk-tasks.entrypoints=websecure'
- 'traefik.http.routers.controls-risk-tasks.tls.certresolver=letsencrypt'
- 'traefik.http.routers.controls-risk-tasks.middlewares=controls-ratelimit'
- 'traefik.http.routers.controls.entrypoints=websecure'
- 'traefik.http.routers.controls.tls.certresolver=letsencrypt'
- 'traefik.http.services.controls.loadbalancer.server.port=3001'
- 'traefik.http.middlewares.controls-ratelimit.ratelimit.average=100'
- 'traefik.http.middlewares.controls-ratelimit.ratelimit.burst=50'
- 'traefik.http.routers.controls.middlewares=controls-ratelimit'
restart: always
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
read_only: true
tmpfs:
- /tmp
- /app/.npm
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:3001/health']
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
# ===========================================
# Frameworks Service - Compliance Frameworks & Risk Management
# ===========================================
frameworks:
build:
context: .
dockerfile: services/frameworks/Dockerfile
args:
NODE_ENV: production
image: grc-frameworks:${IMAGE_TAG:-latest}
container_name: grc-frameworks
environment:
NODE_ENV: production
PORT: 3002
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
S3_ENDPOINT: rustfs
S3_PORT: 9000
S3_USE_SSL: true
S3_ACCESS_KEY: ${MINIO_ROOT_USER}
S3_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
MINIO_ENDPOINT: rustfs
MINIO_PORT: 9000
MINIO_USE_SSL: false
MINIO_ACCESS_KEY: ${MINIO_ROOT_USER}
MINIO_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
KEYCLOAK_URL: http://keycloak:8080/auth
KEYCLOAK_REALM: ${KEYCLOAK_REALM}
JWT_SECRET: ${JWT_SECRET}
LOG_LEVEL: ${LOG_LEVEL:-info}
RATE_LIMIT_ENABLED: ${RATE_LIMIT_ENABLED:-true}
RATE_LIMIT_MAX: ${RATE_LIMIT_MAX:-100}
RATE_LIMIT_WINDOW_MS: ${RATE_LIMIT_WINDOW_MS:-60000}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
keycloak:
condition: service_healthy
rustfs:
condition: service_healthy
networks:
- grc-network
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.frameworks.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/frameworks`)'
- 'traefik.http.routers.frameworks.entrypoints=websecure'
- 'traefik.http.routers.frameworks.tls.certresolver=letsencrypt'
- 'traefik.http.services.frameworks.loadbalancer.server.port=3002'
- 'traefik.http.middlewares.frameworks-ratelimit.ratelimit.average=100'
- 'traefik.http.middlewares.frameworks-ratelimit.ratelimit.burst=50'
- 'traefik.http.routers.frameworks.middlewares=frameworks-ratelimit'
restart: always
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
read_only: true
tmpfs:
- /tmp
- /app/.npm
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:3002/health']
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
# ===========================================
# Policies Service - Policy Center
# ===========================================
policies:
build:
context: .
dockerfile: services/policies/Dockerfile
args:
NODE_ENV: production
image: grc-policies:${IMAGE_TAG:-latest}
container_name: grc-policies
environment:
NODE_ENV: production
PORT: 3004
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
S3_ENDPOINT: rustfs
S3_PORT: 9000
S3_USE_SSL: true
S3_ACCESS_KEY: ${MINIO_ROOT_USER}
S3_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
MINIO_ENDPOINT: rustfs
MINIO_PORT: 9000
MINIO_USE_SSL: false
MINIO_ACCESS_KEY: ${MINIO_ROOT_USER}
MINIO_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
KEYCLOAK_URL: http://keycloak:8080/auth
KEYCLOAK_REALM: ${KEYCLOAK_REALM}
JWT_SECRET: ${JWT_SECRET}
LOG_LEVEL: ${LOG_LEVEL:-info}
RATE_LIMIT_ENABLED: ${RATE_LIMIT_ENABLED:-true}
RATE_LIMIT_MAX: ${RATE_LIMIT_MAX:-100}
RATE_LIMIT_WINDOW_MS: ${RATE_LIMIT_WINDOW_MS:-60000}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
keycloak:
condition: service_healthy
rustfs:
condition: service_healthy
networks:
- grc-network
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.policies.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/policies`)'
- 'traefik.http.routers.policies.entrypoints=websecure'
- 'traefik.http.routers.policies.tls.certresolver=letsencrypt'
- 'traefik.http.services.policies.loadbalancer.server.port=3004'
- 'traefik.http.middlewares.policies-ratelimit.ratelimit.average=100'
- 'traefik.http.middlewares.policies-ratelimit.ratelimit.burst=50'
- 'traefik.http.routers.policies.middlewares=policies-ratelimit'
restart: always
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
read_only: true
tmpfs:
- /tmp
- /app/.npm
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:3004/health']
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
# ===========================================
# TPRM Service - Third Party Risk Management
# ===========================================
tprm:
build:
context: .
dockerfile: services/tprm/Dockerfile
args:
NODE_ENV: production
image: grc-tprm:${IMAGE_TAG:-latest}
container_name: grc-tprm
environment:
NODE_ENV: production
PORT: 3005
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
S3_ENDPOINT: rustfs
S3_PORT: 9000
S3_USE_SSL: true
S3_ACCESS_KEY: ${MINIO_ROOT_USER}
S3_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
MINIO_ENDPOINT: rustfs
MINIO_PORT: 9000
MINIO_USE_SSL: false
MINIO_ACCESS_KEY: ${MINIO_ROOT_USER}
MINIO_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
KEYCLOAK_URL: http://keycloak:8080/auth
KEYCLOAK_REALM: ${KEYCLOAK_REALM}
JWT_SECRET: ${JWT_SECRET}
LOG_LEVEL: ${LOG_LEVEL:-info}
RATE_LIMIT_ENABLED: ${RATE_LIMIT_ENABLED:-true}
RATE_LIMIT_MAX: ${RATE_LIMIT_MAX:-100}
RATE_LIMIT_WINDOW_MS: ${RATE_LIMIT_WINDOW_MS:-60000}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
keycloak:
condition: service_healthy
rustfs:
condition: service_healthy
networks:
- grc-network
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.tprm-vendors.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/vendors`)'
- 'traefik.http.routers.tprm-assessments.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/assessments`)'
- 'traefik.http.routers.tprm-contracts.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/contracts`)'
- 'traefik.http.routers.tprm-vendors.entrypoints=websecure'
- 'traefik.http.routers.tprm-vendors.tls.certresolver=letsencrypt'
- 'traefik.http.services.tprm.loadbalancer.server.port=3005'
- 'traefik.http.middlewares.tprm-ratelimit.ratelimit.average=100'
- 'traefik.http.middlewares.tprm-ratelimit.ratelimit.burst=50'
- 'traefik.http.routers.tprm-vendors.middlewares=tprm-ratelimit'
restart: always
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
read_only: true
tmpfs:
- /tmp
- /app/.npm
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:3005/health']
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
# ===========================================
# Trust Service - Questionnaires & Knowledge Base
# ===========================================
trust:
build:
context: .
dockerfile: services/trust/Dockerfile
args:
NODE_ENV: production
image: grc-trust:${IMAGE_TAG:-latest}
container_name: grc-trust
environment:
NODE_ENV: production
PORT: 3006
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
S3_ENDPOINT: rustfs
S3_PORT: 9000
S3_USE_SSL: true
S3_ACCESS_KEY: ${MINIO_ROOT_USER}
S3_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
MINIO_ENDPOINT: rustfs
MINIO_PORT: 9000
MINIO_USE_SSL: false
MINIO_ACCESS_KEY: ${MINIO_ROOT_USER}
MINIO_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
KEYCLOAK_URL: http://keycloak:8080/auth
KEYCLOAK_REALM: ${KEYCLOAK_REALM}
JWT_SECRET: ${JWT_SECRET}
LOG_LEVEL: ${LOG_LEVEL:-info}
RATE_LIMIT_ENABLED: ${RATE_LIMIT_ENABLED:-true}
RATE_LIMIT_MAX: ${RATE_LIMIT_MAX:-100}
RATE_LIMIT_WINDOW_MS: ${RATE_LIMIT_WINDOW_MS:-60000}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
keycloak:
condition: service_healthy
rustfs:
condition: service_healthy
networks:
- grc-network
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.trust-questionnaires.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/questionnaires`)'
- 'traefik.http.routers.trust-knowledge-base.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/knowledge-base`)'
- 'traefik.http.routers.trust-center.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/trust-center`)'
- 'traefik.http.routers.trust-questionnaires.entrypoints=websecure'
- 'traefik.http.routers.trust-questionnaires.tls.certresolver=letsencrypt'
- 'traefik.http.services.trust.loadbalancer.server.port=3006'
- 'traefik.http.middlewares.trust-ratelimit.ratelimit.average=100'
- 'traefik.http.middlewares.trust-ratelimit.ratelimit.burst=50'
- 'traefik.http.routers.trust-questionnaires.middlewares=trust-ratelimit'
restart: always
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
read_only: true
tmpfs:
- /tmp
- /app/.npm
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:3006/health']
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
# ===========================================
# Audit Service - Internal & External Audits
# ===========================================
audit:
build:
context: .
dockerfile: services/audit/Dockerfile
args:
NODE_ENV: production
image: grc-audit:${IMAGE_TAG:-latest}
container_name: grc-audit
environment:
NODE_ENV: production
PORT: 3007
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
S3_ENDPOINT: rustfs
S3_PORT: 9000
S3_USE_SSL: true
S3_ACCESS_KEY: ${MINIO_ROOT_USER}
S3_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
MINIO_ENDPOINT: rustfs
MINIO_PORT: 9000
MINIO_USE_SSL: false
MINIO_ACCESS_KEY: ${MINIO_ROOT_USER}
MINIO_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
KEYCLOAK_URL: http://keycloak:8080/auth
KEYCLOAK_REALM: ${KEYCLOAK_REALM}
JWT_SECRET: ${JWT_SECRET}
LOG_LEVEL: ${LOG_LEVEL:-info}
RATE_LIMIT_ENABLED: ${RATE_LIMIT_ENABLED:-true}
RATE_LIMIT_MAX: ${RATE_LIMIT_MAX:-100}
RATE_LIMIT_WINDOW_MS: ${RATE_LIMIT_WINDOW_MS:-60000}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
keycloak:
condition: service_healthy
rustfs:
condition: service_healthy
networks:
- grc-network
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.audit-audits.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/audits`)'
- 'traefik.http.routers.audit-requests.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/audit-requests`)'
- 'traefik.http.routers.audit-findings.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/audit-findings`)'
- 'traefik.http.routers.audit-portal.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/audit-portal`)'
- 'traefik.http.routers.audit-audits.entrypoints=websecure'
- 'traefik.http.routers.audit-audits.tls.certresolver=letsencrypt'
- 'traefik.http.services.audit.loadbalancer.server.port=3007'
- 'traefik.http.middlewares.audit-ratelimit.ratelimit.average=100'
- 'traefik.http.middlewares.audit-ratelimit.ratelimit.burst=50'
- 'traefik.http.routers.audit-audits.middlewares=audit-ratelimit'
restart: always
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
read_only: true
tmpfs:
- /tmp
- /app/.npm
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:3007/health']
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
# ===========================================
# Frontend - React SPA with Nginx
# ===========================================
frontend:
build:
context: .
dockerfile: frontend/Dockerfile
args:
VITE_API_URL: ''
VITE_ENABLE_DEV_AUTH: 'false'
image: grc-frontend:${IMAGE_TAG:-latest}
container_name: grc-frontend
depends_on:
- controls
networks:
- grc-network
- grc-dmz
labels:
- 'traefik.enable=true'
- 'traefik.docker.network=grc-dmz'
- 'traefik.http.routers.frontend.rule=Host(`${APP_DOMAIN}`)'
- 'traefik.http.routers.frontend.entrypoints=websecure'
- 'traefik.http.routers.frontend.tls.certresolver=letsencrypt'
- 'traefik.http.routers.frontend.priority=1'
- 'traefik.http.services.frontend.loadbalancer.server.port=80'
- 'traefik.http.middlewares.frontend-headers.headers.stsSeconds=31536000'
- 'traefik.http.middlewares.frontend-headers.headers.stsIncludeSubdomains=true'
- 'traefik.http.middlewares.frontend-headers.headers.stsPreload=true'
- 'traefik.http.middlewares.frontend-headers.headers.contentTypeNosniff=true'
- 'traefik.http.middlewares.frontend-headers.headers.frameDeny=true'
- 'traefik.http.routers.frontend.middlewares=frontend-headers'
restart: always
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
read_only: true
tmpfs:
- /tmp
- /var/cache/nginx
- /run
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:80/']
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
reservations:
cpus: '0.1'
memory: 64M
# ===========================================
# Backup Scheduler - Automated Backups
# ===========================================
# The backup scheduler is a plain network peer on grc-network. It uses
# pg_dump / redis-cli / aws s3 to extract data directly from postgres,
# redis and rustfs over TCP. It does NOT mount /var/run/docker.sock - a
# compromised backup container can no longer introspect or operate on
# other containers on the host.
backup-scheduler:
build:
context: ./deploy
dockerfile: Dockerfile.backup-scheduler
image: grc-backup-scheduler:${IMAGE_TAG:-latest}
container_name: grc-backup-scheduler
environment:
TZ: ${TZ:-UTC}
BACKUP_RETENTION_DAYS: ${BACKUP_RETENTION_DAYS:-90}
DR_REMOTE_BACKUP_ENABLED: ${DR_REMOTE_BACKUP_ENABLED:-false}
DR_REMOTE_BACKUP_S3_BUCKET: ${DR_REMOTE_BACKUP_S3_BUCKET:-}
DR_REMOTE_BACKUP_REGION: ${DR_REMOTE_BACKUP_REGION:-us-east-1}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-}
# PostgreSQL access (network)
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
# Redis access (network)
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
# RustFS / S3 access (network)
S3_ENDPOINT: http://rustfs:9000
S3_BUCKET: ${S3_BUCKET:-grc-storage}