-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathdocker-compose.dev.yaml
More file actions
2393 lines (2330 loc) · 109 KB
/
Copy pathdocker-compose.dev.yaml
File metadata and controls
2393 lines (2330 loc) · 109 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
# ============================================================================
# CAIPE DOCKER COMPOSE DEV CONFIGURATION
# ============================================================================
# Development version of docker-compose.yaml with local builds and file mounts.
# For setup instructions and agent orchestration details, refer to:
# https://cnoe-io.github.io/ai-platform-engineering/getting-started/quick-start
#
# The runtime is the CAIPE UI (BFF) + dynamic-agents. Each tool integration runs
# as a standalone MCP server container (mcp-*); start the ones you need via their
# profile, e.g.:
#
# docker compose -f docker-compose.dev.yaml --profile caipe-ui --profile caipe-mongodb up --build
# docker compose -f docker-compose.dev.yaml --profile mcp-servers up --build # all MCP servers
#
# Agent selection and configuration are controlled through environment variables
# in the .env file—see documentation for full list and descriptions.
# ============================================================================
services:
####################################################################################################
# MongoDB #
####################################################################################################
# MongoDB for CAIPE UI chat history and user settings
# Note: Default password "changeme" is for local development only. For production, use
# the Helm chart and External Secrets to store the MongoDB secret in an external secrets manager.
caipe-mongodb:
image: mongo:7.0
container_name: caipe-mongodb-dev
ports:
# Host port is parameterized for the spec 102 e2e lane (sets MONGODB_HOST_PORT=28017)
# to avoid collision with a host-side MongoDB on 27017. Container port is unchanged.
- "${MONGODB_HOST_PORT:-27017}:27017"
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGODB_ROOT_USERNAME:-admin}
- MONGO_INITDB_ROOT_PASSWORD=${MONGODB_ROOT_PASSWORD:-changeme}
- MONGO_INITDB_DATABASE=${MONGODB_DATABASE:-caipe}
volumes:
- mongodb_data:/data/db
- mongodb_config:/data/configdb
command: ["mongod", "--quiet", "--logpath", "/dev/null"]
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 40s
profiles:
- caipe-mongodb
- caipe-ui
- deps
# MongoDB Admin UI
caipe-ui-mongo-express:
image: mongo-express:latest
container_name: caipe-mongo-express-dev
ports:
- "8081:8081"
environment:
- ME_CONFIG_MONGODB_ADMINUSERNAME=${MONGODB_ROOT_USERNAME:-admin}
- ME_CONFIG_MONGODB_ADMINPASSWORD=${MONGODB_ROOT_PASSWORD:-changeme}
- ME_CONFIG_MONGODB_URL=mongodb://${MONGODB_ROOT_USERNAME:-admin}:${MONGODB_ROOT_PASSWORD:-changeme}@mongodb:27017/
- ME_CONFIG_BASICAUTH=false
profiles:
- caipe-ui-mongo-express
# GitLab MCP Server (@zereight/mcp-gitlab)
# Tool filtering is controlled via GITLAB_DENIED_TOOLS_REGEX using prefix matching (^prefix_)
#
# Example regex patterns for different permission levels:
#
# READ-ONLY (default) - blocks all write operations:
# ^(delete_|remove_|create_|fork_|new_|update_|edit_|merge_|push_|publish_|retry_|cancel_|play_|promote_|upload_|resolve_|bulk_)|^(execute_graphql)$
#
# ALLOW CREATE (can create MRs, issues, etc.) - blocks delete/update:
# ^(delete_|remove_|update_|edit_|merge_|push_|publish_|retry_|cancel_|play_|promote_|upload_|resolve_|bulk_)|^(execute_graphql)$
#
# ALLOW UPDATE (can update MRs, issues, etc.) - blocks delete/create:
# ^(delete_|remove_|create_|fork_|new_)|^(execute_graphql)$
#
# ALLOW CREATE + UPDATE (full write access except delete):
# ^(delete_|remove_)|^(execute_graphql)$
#
# To block specific tools, add them as exact matches: |^(tool1|tool2)$
# Example blocking approve/unapprove: ...|^(execute_graphql|approve_merge_request|unapprove_merge_request)$
#
# Note: execute_graphql is always blocked in the above examples as it bypasses prefix-based permission controls
mcp-gitlab:
image: zereight050/gitlab-mcp:latest
container_name: mcp-gitlab
env_file: [.env]
ports: ["18010:8000"]
environment:
- STREAMABLE_HTTP=true
- HOST=0.0.0.0
- PORT=8000
- MAX_SESSIONS=${GITLAB_MCP_MAX_SESSIONS:-1000}
- MAX_REQUESTS_PER_MINUTE=${GITLAB_MCP_MAX_REQUESTS_PER_MINUTE:-60}
- USE_PIPELINE=true
- GITLAB_API_URL=https://${GITLAB_HOST:-gitlab.com}/api/v4
- GITLAB_PERSONAL_ACCESS_TOKEN=${GITLAB_PERSONAL_ACCESS_TOKEN:-${GITLAB_TOKEN}}
- REMOTE_AUTHORIZATION=${GITLAB_MCP_REMOTE_AUTHORIZATION:-true}
# Option 1: Simple read-only mode (blocks all write operations)
- GITLAB_READ_ONLY_MODE=${GITLAB_READ_ONLY_MODE:-true}
# Option 2: Fine-grained control via regex (see examples in comments above)
# - GITLAB_DENIED_TOOLS_REGEX=${GITLAB_DENIED_TOOLS_REGEX:-^(delete_|remove_|create_|fork_|new_|update_|edit_|merge_|push_|publish_|retry_|cancel_|play_|promote_|upload_|resolve_|bulk_)|^(execute_graphql)$}
profiles:
- gitlab
- all-agents
- mcp-servers
mcp-backstage:
build:
context: .
dockerfile: build/agents/Dockerfile.mcp
args:
- AGENT_NAME=backstage
image: ghcr.io/cnoe-io/mcp-backstage:${IMAGE_TAG:-localtag}
container_name: mcp-backstage
env_file: [.env]
ports: ["18001:8000"]
volumes:
- ./ai_platform_engineering/mcp/backstage:/app/ai_platform_engineering/mcp/backstage
environment:
- MCP_MODE=http
- MCP_HOST=0.0.0.0
- MCP_PORT=8000
healthcheck:
test: ["CMD", "python", "-c", "import socket; s=socket.socket(); s.settimeout(1); result=s.connect_ex(('localhost', 8000)); s.close(); exit(0 if result == 0 else 1)"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
profiles:
- backstage
- all-agents
- mcp-servers
mcp-argocd:
build:
context: .
dockerfile: build/agents/Dockerfile.mcp
args:
- AGENT_NAME=argocd
image: ghcr.io/cnoe-io/mcp-argocd:${IMAGE_TAG:-localtag}
container_name: mcp-argocd
env_file: [.env]
ports: ["18002:8000"]
volumes:
- ./ai_platform_engineering/mcp/argocd:/app/ai_platform_engineering/mcp/argocd
environment:
- MCP_MODE=http
- MCP_HOST=0.0.0.0
- MCP_PORT=8000
healthcheck:
test: ["CMD", "python", "-c", "import socket; s=socket.socket(); s.settimeout(1); result=s.connect_ex(('localhost', 8000)); s.close(); exit(0 if result == 0 else 1)"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
profiles:
- argocd
- all-agents
- mcp-servers
mcp-confluence:
image: ghcr.io/sooperset/mcp-atlassian:latest
container_name: mcp-confluence
env_file: [.env]
ports: ["18003:8000"]
environment:
- CONFLUENCE_URL=${CONFLUENCE_URL}
- CONFLUENCE_USERNAME=${CONFLUENCE_USERNAME}
- CONFLUENCE_API_TOKEN=${CONFLUENCE_API_TOKEN}
profiles:
- confluence
- all-agents
- mcp-servers
mcp-jira:
build:
context: .
dockerfile: build/agents/Dockerfile.mcp
args:
- AGENT_NAME=jira
image: ghcr.io/cnoe-io/mcp-jira:${IMAGE_TAG:-localtag}
container_name: mcp-jira
env_file: [.env]
ports: ["18004:8000"]
volumes:
- ./ai_platform_engineering/mcp/jira:/app/ai_platform_engineering/mcp/jira
environment:
- MCP_MODE=http
- MCP_HOST=0.0.0.0
- MCP_PORT=8000
# AgentGateway is the PEP for the normal gateway path. The Jira MCP
# upstream must not require its own OAuth middleware here, because AGW's
# MCP router does not forward upstream auth per target today. Set
# JIRA_MCP_AUTH_MODE=oauth2 only when testing the direct MCP endpoint.
- MCP_AUTH_MODE=${JIRA_MCP_AUTH_MODE:-none}
- MCP_TRUSTED_LOCALHOST=${JIRA_MCP_TRUSTED_LOCALHOST:-false}
- JWKS_URI=${JIRA_MCP_JWKS_URI:-http://keycloak:7080/realms/caipe/protocol/openid-connect/certs}
- AUDIENCE=${JIRA_MCP_AUDIENCE:-caipe-platform}
- ISSUER=${JIRA_MCP_ISSUER:-http://localhost:7080/realms/caipe}
# Optional PDP check for embedded / direct-local MCP use. Off by default
# for the normal AgentGateway path so CEL remains the RBAC source of truth.
- MCP_PDP_ENABLED=${JIRA_MCP_PDP_ENABLED:-false}
- MCP_PDP_RESOURCE=${JIRA_MCP_PDP_RESOURCE:-mcp_jira}
- MCP_PDP_SCOPE=${JIRA_MCP_PDP_SCOPE:-invoke}
- MCP_PDP_AUDIENCE=${JIRA_MCP_PDP_AUDIENCE:-caipe-platform}
- MCP_PDP_TOKEN_ENDPOINT=${JIRA_MCP_PDP_TOKEN_ENDPOINT:-http://keycloak:7080/realms/caipe/protocol/openid-connect/token}
healthcheck:
test: ["CMD", "python", "-c", "import socket; s=socket.socket(); s.settimeout(1); result=s.connect_ex(('localhost', 8000)); s.close(); exit(0 if result == 0 else 1)"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
profiles:
- jira
- all-agents
- mcp-servers
mcp-komodor:
build:
context: .
dockerfile: build/agents/Dockerfile.mcp
args:
- AGENT_NAME=komodor
image: ghcr.io/cnoe-io/mcp-komodor:${IMAGE_TAG:-localtag}
container_name: mcp-komodor
env_file: [.env]
ports: ["18005:8000"]
volumes:
- ./ai_platform_engineering/mcp/komodor:/app/ai_platform_engineering/mcp/komodor
environment:
- MCP_MODE=http
- MCP_HOST=0.0.0.0
- MCP_PORT=8000
healthcheck:
test: ["CMD", "python", "-c", "import socket; s=socket.socket(); s.settimeout(1); result=s.connect_ex(('localhost', 8000)); s.close(); exit(0 if result == 0 else 1)"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
profiles:
- komodor
- mcp-servers
mcp-pagerduty:
build:
context: .
dockerfile: build/agents/Dockerfile.mcp
args:
- AGENT_NAME=pagerduty
image: ghcr.io/cnoe-io/mcp-pagerduty:${IMAGE_TAG:-localtag}
container_name: mcp-pagerduty
env_file: [.env]
ports: ["18006:8000"]
volumes:
- ./ai_platform_engineering/mcp/pagerduty:/app/ai_platform_engineering/mcp/pagerduty
environment:
- MCP_MODE=http
- MCP_HOST=0.0.0.0
- MCP_PORT=8000
healthcheck:
test: ["CMD", "python", "-c", "import socket; s=socket.socket(); s.settimeout(1); result=s.connect_ex(('localhost', 8000)); s.close(); exit(0 if result == 0 else 1)"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
profiles:
- pagerduty
- all-agents
- mcp-servers
# OSS Slack MCP Server (https://github.com/korotovsky/slack-mcp-server)
mcp-slack:
image: ghcr.io/korotovsky/slack-mcp-server:v1.2.3
container_name: mcp-slack
env_file: [.env]
ports: ["18007:3001"]
environment:
- SLACK_MCP_HOST=0.0.0.0
- SLACK_MCP_PORT=3001
- SLACK_MCP_XOXB_TOKEN=${SLACK_BOT_TOKEN}
# Message posting (disabled by default for safety). Set to 'true' for all
# channels, or restrict to specific channel IDs (comma-separated), or use
# '!' prefix to exclude channels.
# Examples: 'true' (all), 'C123,C456' (whitelist), '!C789' (blacklist)
# - SLACK_MCP_ADD_MESSAGE_TOOL=${SLACK_MCP_ADD_MESSAGE_TOOL:-false}
command: ["--transport", "http"]
healthcheck:
test: ["CMD-SHELL", "curl -so /dev/null -w '%{http_code}' --max-time 2 -X POST http://localhost:3001/mcp | grep -q 400"]
interval: 10s
timeout: 5s
retries: 5
start_period: 60s
profiles:
- slack
- all-agents
- mcp-servers
mcp-splunk:
build:
context: .
dockerfile: build/agents/Dockerfile.mcp
args:
- AGENT_NAME=splunk
image: ghcr.io/cnoe-io/mcp-splunk:${IMAGE_TAG:-localtag}
container_name: mcp-splunk
env_file: [.env]
ports: ["18008:8000"]
volumes:
- ./ai_platform_engineering/mcp/splunk:/app/ai_platform_engineering/mcp/splunk
environment:
- MCP_MODE=http
- MCP_HOST=0.0.0.0
- MCP_PORT=8000
healthcheck:
test: ["CMD", "python", "-c", "import socket; s=socket.socket(); s.settimeout(1); result=s.connect_ex(('localhost', 8000)); s.close(); exit(0 if result == 0 else 1)"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
profiles:
- splunk
- all-agents
- mcp-servers
mcp-webex:
build:
context: .
dockerfile: build/agents/Dockerfile.mcp
args:
- AGENT_NAME=webex
image: ghcr.io/cnoe-io/mcp-webex:${IMAGE_TAG:-localtag}
container_name: mcp-webex
env_file: [.env]
ports: ["18009:8000"]
volumes:
- ./ai_platform_engineering/mcp/webex:/app/ai_platform_engineering/mcp/webex
environment:
- MCP_MODE=http
- MCP_HOST=0.0.0.0
- MCP_PORT=8000
healthcheck:
test: ["CMD", "python", "-c", "import socket; s=socket.socket(); s.settimeout(1); result=s.connect_ex(('localhost', 8000)); s.close(); exit(0 if result == 0 else 1)"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
profiles:
- webex
- all-agents
- mcp-servers
mcp-victorops:
build:
context: .
dockerfile: build/agents/Dockerfile.mcp
args:
- AGENT_NAME=victorops
image: ghcr.io/cnoe-io/mcp-victorops:${IMAGE_TAG:-localtag}
container_name: mcp-victorops
env_file: [.env]
ports: ["18012:8000"]
volumes:
- ./ai_platform_engineering/mcp/victorops:/app/ai_platform_engineering/mcp/victorops
environment:
- MCP_MODE=http
- MCP_HOST=0.0.0.0
- MCP_PORT=8000
healthcheck:
test: ["CMD", "python", "-c", "import socket; s=socket.socket(); s.settimeout(1); result=s.connect_ex(('localhost', 8000)); s.close(); exit(0 if result == 0 else 1)"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
profiles:
- victorops
- mcp-servers
mcp-netutils:
build:
context: .
dockerfile: build/agents/Dockerfile.mcp
args:
- AGENT_NAME=netutils
- INSTALL_NETUTILS=true
image: ghcr.io/cnoe-io/mcp-netutils:${IMAGE_TAG:-localtag}
container_name: mcp-netutils
env_file: [.env]
ports: ["18011:8000"]
volumes:
- ./ai_platform_engineering/mcp/netutils:/app/ai_platform_engineering/mcp/netutils
environment:
- MCP_MODE=http
- MCP_HOST=0.0.0.0
- MCP_PORT=8000
healthcheck:
test: ["CMD", "python", "-c", "import socket; s=socket.socket(); s.settimeout(1); result=s.connect_ex(('localhost', 8000)); s.close(); exit(0 if result == 0 else 1)"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
profiles:
- netutils-agent
- mcp-servers
####################################################################################################
# CAIPE UI #
####################################################################################################
# CAIPE UI — Next.js app + BFF for chat, history, and admin.
# Talks to dynamic-agents over AG-UI/SSE and to per-tool MCP servers.
#
# Build: Uses build/Dockerfile.caipe-ui (Next.js standalone with Node.js server)
# ---------------------------------------------------------------------------
# caipe-ui (hot/dev) and caipe-ui-prod (prod-parity) are TWO first-class
# services that share most env/volumes/depends_on but differ in:
# - build target (`dev` vs `runner`)
# - NODE_ENV (`development` vs `production`)
# - command (`npm run dev` vs `/app/entrypoint.sh`)
# - image suffix (`-dev` vs `-prod`) so both tags persist on disk
# - source bind-mounts (only caipe-ui has ./ui/src etc. for hot reload)
# - profile (`caipe-ui` vs `caipe-ui-prod`)
#
# Two ways to run them:
# make caipe-ui-hot → boots `caipe-ui` via profile `caipe-ui`
# (next dev, hot reload, bind-mounted ./ui/src)
# make caipe-ui-prod → boots `caipe-ui-prod` via profile `caipe-ui-prod`
# (next build + next start, NO hot reload)
#
# IMPORTANT: both services bind host port 3000 — they are MUTUALLY EXCLUSIVE
# at runtime. Keycloak's caipe-ui client only allow-lists
# http://localhost:3000/* as a redirect URI (see deploy/keycloak/realm-config.json),
# so prod-parity must reuse 3000 too. The Makefile targets bring the sibling
# down before bringing the chosen one up.
# ---------------------------------------------------------------------------
caipe-ui:
build:
context: .
dockerfile: build/Dockerfile.caipe-ui
target: dev
args:
- IMAGE_TAG=${IMAGE_TAG:-localtag}
- GIT_COMMIT=${GIT_COMMIT:-unknown}
- BUILD_DATE=${BUILD_DATE:-}
# Local prod-parity rebuilds skip Next's duplicate typecheck; run
# `npm run lint` / targeted tests separately when validating changes.
- CAIPE_UI_FAST_BUILD=${CAIPE_UI_FAST_BUILD:-true}
image: ghcr.io/cnoe-io/caipe-ui:${IMAGE_TAG:-localtag}-dev
container_name: caipe-ui
ports: ["3000:3000"]
env_file:
- .env
environment:
- NODE_ENV=development
# Spec 102 — Playwright sets E2E_RUN=true to enable test-only fixtures
# (see ui/src/lib/test-fixtures.ts). Defaults to false in dev.
- E2E_RUN=${E2E_RUN:-false}
# Enable/Disable RAG Knowledge Bases (default: true)
- RAG_ENABLED=${RAG_ENABLED:-true}
# RAG Server URL for knowledge base API (internal Docker network)
- RAG_SERVER_URL=${RAG_SERVER_URL:-http://rag-server:9446}
- RAG_URL=${RAG_URL:-http://localhost:9446}
# NextAuth configuration (required for production)
# Generate a secret with: openssl rand -base64 32
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET:-caipe-dev-secret-change-in-production}
- NEXTAUTH_URL=${NEXTAUTH_URL:-http://localhost:3000}
# SSO Configuration - reads from .env file
# The app reads SSO_ENABLED, OIDC_CLIENT_ID, OIDC_CLIENT_SECRET, OIDC_ISSUER directly
- SSO_ENABLED=${SSO_ENABLED:-false}
- OIDC_CLIENT_ID=${OIDC_CLIENT_ID:-}
- OIDC_CLIENT_SECRET=${OIDC_CLIENT_SECRET:-}
- OIDC_ISSUER=${OIDC_ISSUER:-}
# Spec 104 — Slack-bot OBO tokens are minted with `aud=agentgateway` so they
# can hit AGW directly. The same token also flows through the BFF on its
# way to AGW, so the BFF must accept that audience too. Adding it here
# via OIDC_EXTRA_AUDIENCES (defaults to "agentgateway") keeps the OBO
# path working without forcing every operator to set the env var.
# The RBAC e2e persona fixture mints tokens from the caipe-platform
# resource-server client, so the dev BFF accepts that audience too.
# For Okta-style deployments, also see OIDC_ACCEPTED_AUDIENCES.
- OIDC_EXTRA_AUDIENCES=${OIDC_EXTRA_AUDIENCES:-agentgateway}
- OIDC_ACCEPTED_AUDIENCES=${OIDC_ACCEPTED_AUDIENCES:-caipe-platform}
# OpenFGA ReBAC reconciliation is opt-in so non-RBAC local UI runs do
# not require the OpenFGA profile. The remote RBAC stack enables it in
# `.env` and writes Team Resources changes as OpenFGA tuples.
- OPENFGA_RECONCILE_ENABLED=${OPENFGA_RECONCILE_ENABLED:-true}
- OPENFGA_HTTP=${OPENFGA_HTTP:-http://openfga:8080}
- OPENFGA_STORE_NAME=${OPENFGA_STORE_NAME:-caipe-openfga}
# Keep local .env role defaults from affecting RAG authorization paths.
- ALLOW_TRUSTED_NETWORK=false
- TRUSTED_NETWORK_CIDRS=
- TRUSTED_NETWORK_DEFAULT_ROLE=
- RBAC_ADMIN_GROUPS=
- RBAC_DEFAULT_AUTHENTICATED_ROLE=
- RBAC_READONLY_GROUPS=
- RBAC_INGESTONLY_GROUPS=
- AUTHZ_TRACING_ENABLED=${AUTHZ_TRACING_ENABLED:-false}
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:-}
# OIDC_DISCOVERY_URL: Docker-internal URL used for server-side discovery +
# token refresh. Defaults to the in-network Keycloak URL so caipe-ui can
# fetch the well-known doc without going via the host. Browser still uses
# OIDC_ISSUER (localhost:7080) for the auth redirect.
- OIDC_DISCOVERY_URL=${OIDC_DISCOVERY_URL:-http://keycloak:7080/realms/caipe}
- OIDC_GROUP_CLAIM=${OIDC_GROUP_CLAIM:-}
- OIDC_REQUIRED_GROUP=${OIDC_REQUIRED_GROUP:-}
- OIDC_REQUIRED_ADMIN_GROUP=${OIDC_REQUIRED_ADMIN_GROUP:-}
- BOOTSTRAP_ADMIN_EMAILS=${BOOTSTRAP_ADMIN_EMAILS:-}
- IDENTITY_SYNC_LOGIN_CLAIMS_ENABLED=${IDENTITY_SYNC_LOGIN_CLAIMS_ENABLED:-true}
# Login-time team auto-creation. STRICT opt-in; defaults to "false" to
# preserve the locked-down login posture. Even with this set to "true",
# the matched identity-group-sync rule must also have auto_create_team=true
# for a team to actually be created (defense in depth — see
# ui/src/lib/rbac/identity-group-sync-planner.ts).
- IDENTITY_SYNC_LOGIN_AUTO_CREATE_TEAMS=${IDENTITY_SYNC_LOGIN_AUTO_CREATE_TEAMS:-false}
- IDENTITY_SYNC_OKTA_ORG_URL=${IDENTITY_SYNC_OKTA_ORG_URL:-}
- IDENTITY_SYNC_OKTA_API_TOKEN=${IDENTITY_SYNC_OKTA_API_TOKEN:-}
# OAuth2 private-key JWT alternative to the SSWS token (takes precedence when set).
- IDENTITY_SYNC_OKTA_OAUTH_CLIENT_ID=${IDENTITY_SYNC_OKTA_OAUTH_CLIENT_ID:-}
- IDENTITY_SYNC_OKTA_OAUTH_KEY_ID=${IDENTITY_SYNC_OKTA_OAUTH_KEY_ID:-}
- IDENTITY_SYNC_OKTA_OAUTH_PRIVATE_KEY=${IDENTITY_SYNC_OKTA_OAUTH_PRIVATE_KEY:-}
- CAIPE_ORG_KEY=${CAIPE_ORG_KEY:-caipe}
- CAIPE_ORG_DISPLAY_NAME=${CAIPE_ORG_DISPLAY_NAME:-CAIPE}
- OIDC_ENABLE_REFRESH_TOKEN=${OIDC_ENABLE_REFRESH_TOKEN:-true}
# UI Branding (optional — set in .env or leave blank for CAIPE defaults)
# No NEXT_PUBLIC_ prefix needed; the server reads process.env at request time
- APP_NAME=${APP_NAME:-}
- TAGLINE=${TAGLINE:-}
- DESCRIPTION=${DESCRIPTION:-}
- LOGO_URL=${LOGO_URL:-}
- LOGO_STYLE=${LOGO_STYLE:-}
- SPINNER_COLOR=${SPINNER_COLOR:-}
- SHOW_POWERED_BY=${SHOW_POWERED_BY:-}
- SUPPORT_EMAIL=${SUPPORT_EMAIL:-}
- PREVIEW_MODE=${PREVIEW_MODE:-}
# Workflow runner - set WORKFLOW_RUNNER_ENABLED=true to show Run Workflow button and Multi-Step Workflows
- WORKFLOW_RUNNER_ENABLED=${WORKFLOW_RUNNER_ENABLED:-false}
# Workflows tab - set WORKFLOWS_ENABLED=true to show the top-level Workflows UI
- WORKFLOWS_ENABLED=${WORKFLOWS_ENABLED:-false}
- DYNAMIC_AGENTS_URL=${DYNAMIC_AGENTS_URL:-http://dynamic-agents:8001}
# Skill Scanner — when the `skill-scanner` profile is enabled, the UI
# uploads ZIP'd skill packages to this service for security scanning.
# If unreachable the UI gracefully reports "scanner unavailable" instead
# of failing the skill save.
- SKILL_SCANNER_URL=${SKILL_SCANNER_URL:-http://skill-scanner:8000}
# Skill Hub GitHub crawl/import token. Keep the value in .env or the shell;
# never hardcode tokens in compose.
- GITHUB_TOKEN=${GITHUB_TOKEN:-${GITHUB_PERSONAL_ACCESS_TOKEN:-}}
# MongoDB (when running with profile caipe-ui; mongodb service is in same profile)
# (changeme default is for local dev only; for production use Helm chart and External Secrets)
- MONGODB_URI=${MONGODB_URI:-mongodb://admin:changeme@caipe-mongodb:27017/caipe?authSource=admin}
- MONGODB_DATABASE=${MONGODB_DATABASE:-caipe}
- AGENTGATEWAY_TARGETS_TOKEN=${AGENTGATEWAY_TARGETS_TOKEN:-agentgateway-config-bridge-dev-token}
# Connections & Secrets. Local OAuth connector bootstrap reads these
# values from .env; Kubernetes deployments use ESO to inject the same
# variable names into caipe-ui.
- CAIPE_CREDENTIALS_ENABLED=${CAIPE_CREDENTIALS_ENABLED:-false}
- CREDENTIAL_STORE_BACKEND=${CREDENTIAL_STORE_BACKEND:-mongodb-envelope}
- CREDENTIAL_KEY_PROVIDER=${CREDENTIAL_KEY_PROVIDER:-local-cmk}
- CREDENTIAL_KMS_CMK_ID=${CREDENTIAL_KMS_CMK_ID:-}
- CREDENTIAL_KMS_REGION=${CREDENTIAL_KMS_REGION:-}
# DEV-ONLY escape hatch: lets the local (local-cmk/dev-local) key wrapper
# run under NODE_ENV=production for prod-parity testing. INSECURE — keys
# are wrapped with locally-derived material, not a real KMS/HSM. Never set
# this true in a real production deployment.
- CREDENTIAL_ALLOW_INSECURE_LOCAL_KEY_WRAP=${CREDENTIAL_ALLOW_INSECURE_LOCAL_KEY_WRAP:-false}
- CREDENTIAL_SERVICE_AUDIENCE=${CREDENTIAL_SERVICE_AUDIENCE:-caipe-credential-service}
- CREDENTIAL_BOOTSTRAP_OAUTH_CONNECTORS=${CREDENTIAL_BOOTSTRAP_OAUTH_CONNECTORS:-false}
- GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID:-}
- GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET:-}
- GITHUB_REDIRECT_URI=${GITHUB_REDIRECT_URI:-}
- CONFLUENCE_CLIENT_ID=${CONFLUENCE_CLIENT_ID:-}
- CONFLUENCE_CLIENT_SECRET=${CONFLUENCE_CLIENT_SECRET:-}
- CONFLUENCE_REDIRECT_URI=${CONFLUENCE_REDIRECT_URI:-}
- WEBEX_CLIENT_ID=${WEBEX_CLIENT_ID:-}
- WEBEX_CLIENT_SECRET=${WEBEX_CLIENT_SECRET:-}
- WEBEX_REDIRECT_URI=${WEBEX_REDIRECT_URI:-}
- PAGERDUTY_CLIENT_ID=${PAGERDUTY_CLIENT_ID:-}
- PAGERDUTY_CLIENT_SECRET=${PAGERDUTY_CLIENT_SECRET:-}
- PAGERDUTY_REDIRECT_URI=${PAGERDUTY_REDIRECT_URI:-}
- PAGERDUTY_SCOPES=${PAGERDUTY_SCOPES:-}
# 098 Enterprise RBAC — Keycloak AuthZ (requires --profile rbac)
- KEYCLOAK_URL=${KEYCLOAK_URL:-http://keycloak:7080}
- KEYCLOAK_REALM=${KEYCLOAK_REALM:-caipe}
- KEYCLOAK_RESOURCE_SERVER_ID=${KEYCLOAK_RESOURCE_SERVER_ID:-caipe-platform}
- KEYCLOAK_CLIENT_SECRET=${KEYCLOAK_CLIENT_SECRET:-caipe-platform-dev-secret}
- RBAC_CACHE_TTL_SECONDS=${RBAC_CACHE_TTL_SECONDS:-60}
# 098 Enterprise RBAC — Keycloak Admin API (US6: role/mapping CRUD from Admin UI)
- KEYCLOAK_ADMIN_CLIENT_ID=${KEYCLOAK_ADMIN_CLIENT_ID:-admin-cli}
- KEYCLOAK_ADMIN_CLIENT_SECRET=${KEYCLOAK_ADMIN_CLIENT_SECRET:-}
# Production-safety gate (R1) for the BFF admin/admin fallback in
# `ui/src/lib/rbac/keycloak-admin.ts`. Default-on in dev so a fresh
# docker-compose stack still boots before the operator wires a real
# service-account secret. NEVER set this to "true" in a production
# chart values file — see the comment in
# charts/.../caipe-ui/values.yaml.
- ALLOW_KEYCLOAK_ADMIN_PASSWORD_FALLBACK=${ALLOW_KEYCLOAK_ADMIN_PASSWORD_FALLBACK:-true}
# 098 Slack identity linking HMAC secret (shared with slack-bot)
- SLACK_LINK_HMAC_SECRET=${SLACK_LINK_HMAC_SECRET:-${SLACK_SIGNING_SECRET:-}}
- SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN:-}
# Canonical Slack workspace namespace used by UI-managed Slack ReBAC/routes.
- SLACK_WORKSPACE_ALIAS=${SLACK_WORKSPACE_ALIAS:-CAIPE}
# UI BFF -> Slack bot admin API. The browser never calls the bot directly;
# caipe-ui obtains this token server-side using OIDC_CLIENT_ID/_SECRET.
- SLACK_BOT_ADMIN_URL=${SLACK_BOT_ADMIN_URL:-http://slack-bot:3001}
- SLACK_BOT_ADMIN_AUDIENCE=${SLACK_BOT_ADMIN_AUDIENCE:-caipe-slack-bot-admin}
- SLACK_BOT_ADMIN_TOKEN_URL=${SLACK_BOT_ADMIN_TOKEN_URL:-http://keycloak:7080/realms/caipe/protocol/openid-connect/token}
- SLACK_BOT_ADMIN_DEV_AUTH_ENABLED=${SLACK_BOT_ADMIN_DEV_AUTH_ENABLED:-false}
- SLACK_BOT_ADMIN_DEV_TOKEN=${SLACK_BOT_ADMIN_DEV_TOKEN:-}
- WEBEX_INTEGRATION_BOT_ACCESS_TOKEN=${WEBEX_INTEGRATION_BOT_ACCESS_TOKEN:-}
- WEBEX_WORKSPACE_ALIAS=${WEBEX_WORKSPACE_ALIAS:-CAIPE-WEBEX}
- WEBEX_LINK_HMAC_SECRET=${WEBEX_LINK_HMAC_SECRET:-${WEBEX_SIGNING_SECRET:-}}
- WEBEX_BOT_ADMIN_URL=${WEBEX_BOT_ADMIN_URL:-http://webex-bot:3002}
- WEBEX_BOT_ADMIN_CLIENT_ID=${WEBEX_BOT_ADMIN_CLIENT_ID:-caipe-ui}
- WEBEX_BOT_ADMIN_CLIENT_SECRET=${WEBEX_BOT_ADMIN_CLIENT_SECRET:-}
- WEBEX_BOT_ADMIN_AUDIENCE=${WEBEX_BOT_ADMIN_AUDIENCE:-caipe-webex-bot-admin}
- WEBEX_BOT_ADMIN_TOKEN_URL=${WEBEX_BOT_ADMIN_TOKEN_URL:-http://keycloak:7080/realms/caipe/protocol/openid-connect/token}
# App config: loaded at Next.js startup via instrumentation.ts.
# APP_CONFIG_FILE on the host (set in .env) selects which file is
# mounted — defaults to the committed example template (./config/app-config.yaml,
# which seeds nothing). For local dev, set in .env:
# APP_CONFIG_FILE=./config/app-config.local.yaml
# config/*.local.yaml is gitignored (see .gitignore).
- APP_CONFIG_PATH=/app/config/app-config.yaml
# Audit log storage is owned by the lightweight Python audit-service.
- AUDIT_LOG_BACKEND=${AUDIT_LOG_BACKEND:-service}
- AUDIT_SERVICE_URL=${AUDIT_SERVICE_URL:-http://audit-service:8010}
volumes:
# Override host path with CAIPE_APP_CONFIG_FILE (preferred; matches main's naming) or
# legacy APP_CONFIG_FILE (kept for back-compat with existing .env files on this branch).
# If neither is set, mount the committed example template config/app-config.yaml.
- ${CAIPE_APP_CONFIG_FILE:-${APP_CONFIG_FILE:-./config/app-config.yaml}}:/app/config/app-config.yaml:ro
- ./charts/ai-platform-engineering/data/skills:/charts/ai-platform-engineering/data/skills:ro
# Hot-reload bind mounts. These are SAFE in prod because the
# `runner` stage uses Next standalone output and never reads
# /app/src, /app/next.config.ts, etc. They are USED in dev when
# the `dev` stage runs `next dev` (CAIPE_UI_BUILD_TARGET=dev).
# Note: ui/public is intentionally NOT mounted — mounting it
# would shadow the prod runner's prebuilt public/ (entrypoint.sh
# writes env-config.js into it). For public/ asset edits in hot
# mode, just rebuild the image; src/ changes are the 99% case.
- ./ui/src:/app/src
- ./ui/next.config.ts:/app/next.config.ts
- ./ui/tsconfig.json:/app/tsconfig.json
- ./ui/postcss.config.mjs:/app/postcss.config.mjs
- ./ui/eslint.config.mjs:/app/eslint.config.mjs
# Do not mount /app/node_modules or /app/.next here: this compose file
# bind-mounts only selected source/config files, so the dev image's
# installed dependencies and generated Next cache stay intact.
# Hot-reload command: next dev rebuilds on edits to bind-mounted ./ui/src.
command: npm run dev
depends_on:
# RBAC profile: wait for realm/JWKS readiness before UI startup seed/scope sync
# calls Keycloak Admin APIs. Non-RBAC UI runs keep working because this
# dependency is optional when the keycloak service is not selected.
keycloak:
condition: service_healthy
required: false
audit-service:
condition: service_healthy
required: false
profiles:
- caipe-ui
# caipe-ui-prod — prod-parity sibling of caipe-ui (see header above).
# Runs the runner stage with NODE_ENV=production and `next start` against
# the prebuilt .next/standalone bundle. No source bind-mounts: source edits
# require a rebuild (`make caipe-ui-prod`). Same env/secrets/depends_on as
# caipe-ui — only build target, NODE_ENV, image suffix, command, and
# profile differ. Env-var defaults are duplicated rather than anchored
# because docker-compose YAML anchors don't merge `environment:` lists
# cleanly across services.
caipe-ui-prod:
build:
context: .
dockerfile: build/Dockerfile.caipe-ui
target: runner
args:
- IMAGE_TAG=${IMAGE_TAG:-localtag}
- GIT_COMMIT=${GIT_COMMIT:-unknown}
- BUILD_DATE=${BUILD_DATE:-}
# Local prod-parity rebuilds skip Next's duplicate typecheck; run
# `npm run lint` / targeted tests separately when validating changes.
- CAIPE_UI_FAST_BUILD=${CAIPE_UI_FAST_BUILD:-true}
image: ghcr.io/cnoe-io/caipe-ui-prod:${IMAGE_TAG:-localtag}
container_name: caipe-ui-prod
# Same host port as caipe-ui — these two services are mutually exclusive.
# Keycloak's caipe-ui client only allow-lists http://localhost:3000/*.
ports: ["3000:3000"]
# Slack-bot, webex-bot, dynamic-agents, and a handful of other sibling
# services hardcode the in-network hostname `http://caipe-ui:3000` for
# CAIPE_API_URL/CREDENTIAL_API_URL. The hot-reload `caipe-ui` service
# gets that hostname for free via its container_name, but this prod
# sibling needs an explicit network alias so the same env var resolves
# when only `caipe-ui-prod` is up.
networks:
default:
aliases:
- caipe-ui
env_file:
- .env
environment:
- NODE_ENV=production
- E2E_RUN=${E2E_RUN:-false}
- RAG_ENABLED=${RAG_ENABLED:-true}
- RAG_SERVER_URL=${RAG_SERVER_URL:-http://rag-server:9446}
- RAG_URL=${RAG_URL:-http://localhost:9446}
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET:-caipe-dev-secret-change-in-production}
- NEXTAUTH_URL=${NEXTAUTH_URL:-http://localhost:3000}
- SSO_ENABLED=${SSO_ENABLED:-false}
- OIDC_CLIENT_ID=${OIDC_CLIENT_ID:-}
- OIDC_CLIENT_SECRET=${OIDC_CLIENT_SECRET:-}
- OIDC_ISSUER=${OIDC_ISSUER:-}
- OIDC_EXTRA_AUDIENCES=${OIDC_EXTRA_AUDIENCES:-agentgateway}
- OIDC_ACCEPTED_AUDIENCES=${OIDC_ACCEPTED_AUDIENCES:-caipe-platform}
- OPENFGA_RECONCILE_ENABLED=${OPENFGA_RECONCILE_ENABLED:-true}
- OPENFGA_HTTP=${OPENFGA_HTTP:-http://openfga:8080}
- OPENFGA_STORE_NAME=${OPENFGA_STORE_NAME:-caipe-openfga}
# Keep local .env role defaults from affecting RAG authorization paths.
- ALLOW_TRUSTED_NETWORK=false
- TRUSTED_NETWORK_CIDRS=
- TRUSTED_NETWORK_DEFAULT_ROLE=
- RBAC_ADMIN_GROUPS=
- RBAC_DEFAULT_AUTHENTICATED_ROLE=
- RBAC_READONLY_GROUPS=
- RBAC_INGESTONLY_GROUPS=
- AUTHZ_TRACING_ENABLED=${AUTHZ_TRACING_ENABLED:-false}
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:-}
- OIDC_DISCOVERY_URL=${OIDC_DISCOVERY_URL:-http://keycloak:7080/realms/caipe}
- OIDC_GROUP_CLAIM=${OIDC_GROUP_CLAIM:-}
- OIDC_REQUIRED_GROUP=${OIDC_REQUIRED_GROUP:-}
- OIDC_REQUIRED_ADMIN_GROUP=${OIDC_REQUIRED_ADMIN_GROUP:-}
- BOOTSTRAP_ADMIN_EMAILS=${BOOTSTRAP_ADMIN_EMAILS:-}
- IDENTITY_SYNC_LOGIN_CLAIMS_ENABLED=${IDENTITY_SYNC_LOGIN_CLAIMS_ENABLED:-true}
- IDENTITY_SYNC_LOGIN_AUTO_CREATE_TEAMS=${IDENTITY_SYNC_LOGIN_AUTO_CREATE_TEAMS:-false}
- IDENTITY_SYNC_OKTA_ORG_URL=${IDENTITY_SYNC_OKTA_ORG_URL:-}
- IDENTITY_SYNC_OKTA_API_TOKEN=${IDENTITY_SYNC_OKTA_API_TOKEN:-}
# OAuth2 private-key JWT alternative to the SSWS token (takes precedence when set).
- IDENTITY_SYNC_OKTA_OAUTH_CLIENT_ID=${IDENTITY_SYNC_OKTA_OAUTH_CLIENT_ID:-}
- IDENTITY_SYNC_OKTA_OAUTH_KEY_ID=${IDENTITY_SYNC_OKTA_OAUTH_KEY_ID:-}
- IDENTITY_SYNC_OKTA_OAUTH_PRIVATE_KEY=${IDENTITY_SYNC_OKTA_OAUTH_PRIVATE_KEY:-}
- CAIPE_ORG_KEY=${CAIPE_ORG_KEY:-caipe}
- CAIPE_ORG_DISPLAY_NAME=${CAIPE_ORG_DISPLAY_NAME:-CAIPE}
- OIDC_ENABLE_REFRESH_TOKEN=${OIDC_ENABLE_REFRESH_TOKEN:-true}
- APP_NAME=${APP_NAME:-}
- TAGLINE=${TAGLINE:-}
- DESCRIPTION=${DESCRIPTION:-}
- LOGO_URL=${LOGO_URL:-}
- LOGO_STYLE=${LOGO_STYLE:-}
- SPINNER_COLOR=${SPINNER_COLOR:-}
- SHOW_POWERED_BY=${SHOW_POWERED_BY:-}
- SUPPORT_EMAIL=${SUPPORT_EMAIL:-}
- PREVIEW_MODE=${PREVIEW_MODE:-}
- WORKFLOW_RUNNER_ENABLED=${WORKFLOW_RUNNER_ENABLED:-false}
- WORKFLOWS_ENABLED=${WORKFLOWS_ENABLED:-false}
- DYNAMIC_AGENTS_URL=${DYNAMIC_AGENTS_URL:-http://dynamic-agents:8001}
- SKILL_SCANNER_URL=${SKILL_SCANNER_URL:-http://skill-scanner:8000}
- GITHUB_TOKEN=${GITHUB_TOKEN:-${GITHUB_PERSONAL_ACCESS_TOKEN:-}}
- MONGODB_URI=${MONGODB_URI:-mongodb://admin:changeme@caipe-mongodb:27017/caipe?authSource=admin}
- MONGODB_DATABASE=${MONGODB_DATABASE:-caipe}
- AGENTGATEWAY_TARGETS_TOKEN=${AGENTGATEWAY_TARGETS_TOKEN:-agentgateway-config-bridge-dev-token}
- CAIPE_CREDENTIALS_ENABLED=${CAIPE_CREDENTIALS_ENABLED:-false}
- CREDENTIAL_STORE_BACKEND=${CREDENTIAL_STORE_BACKEND:-mongodb-envelope}
- CREDENTIAL_KEY_PROVIDER=${CREDENTIAL_KEY_PROVIDER:-local-cmk}
- CREDENTIAL_KMS_CMK_ID=${CREDENTIAL_KMS_CMK_ID:-}
- CREDENTIAL_KMS_REGION=${CREDENTIAL_KMS_REGION:-}
# DEV-ONLY escape hatch (prod-parity image runs NODE_ENV=production). Lets
# the local key wrapper run despite production. INSECURE — never set true
# in a real production deployment. See build/Dockerfile.caipe-ui header.
- CREDENTIAL_ALLOW_INSECURE_LOCAL_KEY_WRAP=${CREDENTIAL_ALLOW_INSECURE_LOCAL_KEY_WRAP:-false}
- CREDENTIAL_ALLOW_LOCALHOST_OAUTH_REDIRECTS=${CREDENTIAL_ALLOW_LOCALHOST_OAUTH_REDIRECTS:-true}
- CREDENTIAL_SERVICE_AUDIENCE=${CREDENTIAL_SERVICE_AUDIENCE:-caipe-credential-service}
- CREDENTIAL_BOOTSTRAP_OAUTH_CONNECTORS=${CREDENTIAL_BOOTSTRAP_OAUTH_CONNECTORS:-false}
- GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID:-}
- GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET:-}
- GITHUB_REDIRECT_URI=${GITHUB_REDIRECT_URI:-}
- CONFLUENCE_CLIENT_ID=${CONFLUENCE_CLIENT_ID:-}
- CONFLUENCE_CLIENT_SECRET=${CONFLUENCE_CLIENT_SECRET:-}
- CONFLUENCE_REDIRECT_URI=${CONFLUENCE_REDIRECT_URI:-}
- WEBEX_CLIENT_ID=${WEBEX_CLIENT_ID:-}
- WEBEX_CLIENT_SECRET=${WEBEX_CLIENT_SECRET:-}
- WEBEX_REDIRECT_URI=${WEBEX_REDIRECT_URI:-}
- PAGERDUTY_CLIENT_ID=${PAGERDUTY_CLIENT_ID:-}
- PAGERDUTY_CLIENT_SECRET=${PAGERDUTY_CLIENT_SECRET:-}
- PAGERDUTY_REDIRECT_URI=${PAGERDUTY_REDIRECT_URI:-}
- PAGERDUTY_SCOPES=${PAGERDUTY_SCOPES:-}
- KEYCLOAK_URL=${KEYCLOAK_URL:-http://keycloak:7080}
- KEYCLOAK_REALM=${KEYCLOAK_REALM:-caipe}
- KEYCLOAK_RESOURCE_SERVER_ID=${KEYCLOAK_RESOURCE_SERVER_ID:-caipe-platform}
- KEYCLOAK_CLIENT_SECRET=${KEYCLOAK_CLIENT_SECRET:-caipe-platform-dev-secret}
- RBAC_CACHE_TTL_SECONDS=${RBAC_CACHE_TTL_SECONDS:-60}
- KEYCLOAK_ADMIN_CLIENT_ID=${KEYCLOAK_ADMIN_CLIENT_ID:-admin-cli}
- KEYCLOAK_ADMIN_CLIENT_SECRET=${KEYCLOAK_ADMIN_CLIENT_SECRET:-}
- ALLOW_KEYCLOAK_ADMIN_PASSWORD_FALLBACK=${ALLOW_KEYCLOAK_ADMIN_PASSWORD_FALLBACK:-true}
- SLACK_LINK_HMAC_SECRET=${SLACK_LINK_HMAC_SECRET:-${SLACK_SIGNING_SECRET:-}}
- SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN:-}
- SLACK_WORKSPACE_ALIAS=${SLACK_WORKSPACE_ALIAS:-CAIPE}
- SLACK_BOT_ADMIN_URL=${SLACK_BOT_ADMIN_URL:-http://slack-bot:3001}
- SLACK_BOT_ADMIN_AUDIENCE=${SLACK_BOT_ADMIN_AUDIENCE:-caipe-slack-bot-admin}
- SLACK_BOT_ADMIN_TOKEN_URL=${SLACK_BOT_ADMIN_TOKEN_URL:-http://keycloak:7080/realms/caipe/protocol/openid-connect/token}
- SLACK_BOT_ADMIN_DEV_AUTH_ENABLED=${SLACK_BOT_ADMIN_DEV_AUTH_ENABLED:-false}
- SLACK_BOT_ADMIN_DEV_TOKEN=${SLACK_BOT_ADMIN_DEV_TOKEN:-}
- WEBEX_INTEGRATION_BOT_ACCESS_TOKEN=${WEBEX_INTEGRATION_BOT_ACCESS_TOKEN:-}
- WEBEX_WORKSPACE_ALIAS=${WEBEX_WORKSPACE_ALIAS:-CAIPE-WEBEX}
- WEBEX_LINK_HMAC_SECRET=${WEBEX_LINK_HMAC_SECRET:-${WEBEX_SIGNING_SECRET:-}}
- WEBEX_BOT_ADMIN_URL=${WEBEX_BOT_ADMIN_URL:-http://webex-bot:3002}
- WEBEX_BOT_ADMIN_CLIENT_ID=${WEBEX_BOT_ADMIN_CLIENT_ID:-caipe-ui}
- WEBEX_BOT_ADMIN_CLIENT_SECRET=${WEBEX_BOT_ADMIN_CLIENT_SECRET:-}
- WEBEX_BOT_ADMIN_AUDIENCE=${WEBEX_BOT_ADMIN_AUDIENCE:-caipe-webex-bot-admin}
- WEBEX_BOT_ADMIN_TOKEN_URL=${WEBEX_BOT_ADMIN_TOKEN_URL:-http://keycloak:7080/realms/caipe/protocol/openid-connect/token}
- APP_CONFIG_PATH=/app/config/app-config.yaml
# Audit log storage is owned by the lightweight Python audit-service.
- AUDIT_LOG_BACKEND=${AUDIT_LOG_BACKEND:-service}
- AUDIT_SERVICE_URL=${AUDIT_SERVICE_URL:-http://audit-service:8010}
volumes:
# App config only — NO source bind-mounts. The runner stage uses the
# prebuilt .next/standalone bundle and ignores ./ui/src etc., so any
# bind-mount here would either be dead weight or actively shadow
# the prod runner's prebuilt assets (e.g. ui/public, which the
# entrypoint writes env-config.js into).
- ${CAIPE_APP_CONFIG_FILE:-${APP_CONFIG_FILE:-./config/app-config.yaml}}:/app/config/app-config.yaml:ro
- ./charts/ai-platform-engineering/data/skills:/charts/ai-platform-engineering/data/skills:ro
command: /app/entrypoint.sh
depends_on:
keycloak:
condition: service_healthy
required: false
audit-service:
condition: service_healthy
required: false
profiles:
- caipe-ui-prod
####################################################################################################
# Audit Service #
####################################################################################################
# Lightweight audit collector. caipe-ui can use it with AUDIT_LOG_BACKEND=service.
# It accepts JSON batches quickly, buffers with asyncio.Queue, flushes gzip
# NDJSON to local storage, and serves bounded read queries over the same data.
audit-service:
build:
context: .
dockerfile: build/Dockerfile.audit-service
image: ghcr.io/cnoe-io/caipe-audit-service:${IMAGE_TAG:-localtag}
container_name: audit-service
ports:
- "127.0.0.1:${AUDIT_SERVICE_PORT:-8010}:8010"
environment:
AUDIT_SERVICE_BACKEND: ${AUDIT_SERVICE_BACKEND:-local}
AUDIT_SERVICE_LOCAL_PATH: /var/lib/caipe-audit-service
AUDIT_SERVICE_LOCAL_GZIP: ${AUDIT_SERVICE_LOCAL_GZIP:-true}
AUDIT_SERVICE_LOCAL_RETENTION_DAYS: ${AUDIT_SERVICE_LOCAL_RETENTION_DAYS:-1}
AUDIT_SERVICE_S3_BUCKET: ${AUDIT_SERVICE_S3_BUCKET:-}
AUDIT_SERVICE_S3_PREFIX: ${AUDIT_SERVICE_S3_PREFIX:-audit}
AUDIT_SERVICE_S3_REGION: ${AUDIT_SERVICE_S3_REGION:-us-east-2}
AUDIT_SERVICE_S3_ENDPOINT_URL: ${AUDIT_SERVICE_S3_ENDPOINT_URL:-}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-}
AWS_SESSION_TOKEN: ${AWS_SESSION_TOKEN:-}
AWS_REGION: ${AWS_REGION:-us-east-2}
AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION:-us-east-2}
AUDIT_SERVICE_QUEUE_MAX_SIZE: ${AUDIT_SERVICE_QUEUE_MAX_SIZE:-10000}
AUDIT_SERVICE_FLUSH_BATCH_SIZE: ${AUDIT_SERVICE_FLUSH_BATCH_SIZE:-500}
AUDIT_SERVICE_FLUSH_INTERVAL_SECONDS: ${AUDIT_SERVICE_FLUSH_INTERVAL_SECONDS:-1}
AUDIT_SERVICE_READ_DEFAULT_LIMIT: ${AUDIT_SERVICE_READ_DEFAULT_LIMIT:-1000}
AUDIT_SERVICE_READ_MAX_LIMIT: ${AUDIT_SERVICE_READ_MAX_LIMIT:-10000}
AUDIT_SERVICE_READ_MAX_DAYS: ${AUDIT_SERVICE_READ_MAX_DAYS:-31}
volumes:
- audit_service_data:/var/lib/caipe-audit-service
healthcheck:
test:
- CMD
- python
- -c
- "import json,urllib.request,sys; r=urllib.request.urlopen('http://127.0.0.1:8010/readyz',timeout=3); sys.exit(0 if r.status==200 and json.load(r).get('status')=='ready' else 1)"
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
profiles:
- audit-service
- caipe-ui
- caipe-ui-prod
- rbac
####################################################################################################
# Dynamic Agents #
####################################################################################################
# Dynamic Agents - Standalone agent builder service using deepagents library
# Creates ephemeral AI agents configured through the UI with MCP tool support
#
# Configuration:
# - Requires MongoDB for agent/MCP server configuration storage
# - Supports OIDC authentication (same config as CAIPE UI)
#
# Ports:
# - 8100: Dynamic Agents API (proxied via UI at /api/dynamic-agents)
dynamic-agents:
build:
context: ./ai_platform_engineering/dynamic_agents
dockerfile: build/Dockerfile
image: ghcr.io/cnoe-io/caipe-dynamic-agents:${IMAGE_TAG:-localtag}
container_name: dynamic-agents
ports: ["8100:8001"]
volumes:
# Mount source for hot reload in development
- ./ai_platform_engineering/dynamic_agents/src:/app/dynamic_agents/src
- ${HOME}/.aws:/home/app/.aws:ro
# Spec 102 — PDP-unavailable fallback (no-op in dev).
- ${RBAC_FALLBACK_FILE:-/dev/null}:/etc/keycloak/realm-config-extras.json:ro
env_file: [.env]
environment:
# Dev-only: DEV_HOT_RELOAD toggles the existing DEBUG-driven uvicorn reload
# on the bind-mounted source under /app/dynamic_agents/src. Default off.
- DEBUG=${DEV_HOT_RELOAD:-false}
- AWS_CONFIG_FILE=/home/app/.aws/config
- AWS_SHARED_CREDENTIALS_FILE=/home/app/.aws/credentials
- RBAC_FALLBACK_CONFIG_PATH=${RBAC_FALLBACK_CONFIG_PATH:-}
- AWS_BEDROCK_STREAMING=${AWS_BEDROCK_STREAMING:-false}
- AWS_BEDROCK_USE_CONVERSE_API=${AWS_BEDROCK_USE_CONVERSE_API:-true}
- AWS_BEDROCK_BASE_MODEL_ID=${AWS_BEDROCK_BASE_MODEL_ID:-}
# MongoDB (same as CAIPE UI)
- MONGODB_URI=${MONGODB_URI:-mongodb://${MONGODB_ROOT_USERNAME:-admin}:${MONGODB_ROOT_PASSWORD:-changeme}@caipe-mongodb:27017/${MONGODB_DATABASE:-caipe}?authSource=admin}
- MONGODB_DATABASE=${MONGODB_DATABASE:-caipe}
# Authentication (same OIDC config as CAIPE UI)
- AUTH_ENABLED=${AUTH_ENABLED:-false}
- OIDC_ISSUER=${OIDC_ISSUER:-}
- OIDC_CLIENT_ID=${OIDC_CLIENT_ID:-}
- OIDC_DISCOVERY_URL=${OIDC_DISCOVERY_URL:-}
- OIDC_GROUP_CLAIM=${OIDC_GROUP_CLAIM:-}
- OIDC_REQUIRED_ADMIN_GROUP=${OIDC_REQUIRED_ADMIN_GROUP:-}
# Centralized Authorization Service — DA delegates agent-use decisions to the
# BFF's /api/authz/v1/decisions (forwards the caller's bearer / OBO). DA fails
# closed if unset or unreachable. Point at whichever UI service is running.
- AUTHZ_SERVICE_URL=${AUTHZ_SERVICE_URL:-http://caipe-ui-prod:3000}
# Tracing (Langfuse)
- ENABLE_TRACING=${ENABLE_TRACING:-false}
- LANGFUSE_PUBLIC_KEY=${LANGFUSE_PUBLIC_KEY:-}
- LANGFUSE_SECRET_KEY=${LANGFUSE_SECRET_KEY:-}
- LANGFUSE_HOST=${LANGFUSE_HOST:-http://langfuse-web:3000}
# Runtime configuration
- LOG_LEVEL=${DYNAMIC_AGENTS_LOG_LEVEL:-DEBUG}
- DEFAULT_RUNTIME_BACKEND=${DEFAULT_RUNTIME_BACKEND:-store}
- ENABLE_TRACING=${ENABLE_TRACING:-false}
- LANGFUSE_PUBLIC_KEY=${LANGFUSE_PUBLIC_KEY:-}
- LANGFUSE_SECRET_KEY=${LANGFUSE_SECRET_KEY:-}
- LANGFUSE_HOST=${LANGFUSE_HOST:-http://langfuse-web:3000}
- AGENT_RUNTIME_TTL_SECONDS=${AGENT_RUNTIME_TTL_SECONDS:-60}
# Keep uvicorn reload off in Docker. DEBUG=true from .env can make the
# mounted dev service hang during startup; the UI gateway still injects
# dev user context when auth is disabled.
- DEBUG=${DYNAMIC_AGENTS_DEBUG:-false}
# CORS_ORIGINS: must be a JSON array (bare "*" from prod default is not valid JSON for list[str])
# To restrict origins, set DYNAMIC_AGENTS_CORS_ORIGINS='["http://localhost:3000"]' in .env
- CORS_ORIGINS=${DYNAMIC_AGENTS_CORS_ORIGINS:-["*"]}
# Agent Gateway — MCP routing through AG for dynamic agents
- AGENT_GATEWAY_URL=${AGENT_GATEWAY_URL:-http://agentgateway:4000}
# AgentGateway fronts every network MCP target with one route/backend per
# server so one failing optional MCP does not break unrelated tools.
# Optional shared secret for signed Dynamic Agent -> AgentGateway agent_id context.
# Leave unset to keep only the coarse user-level AgentGateway/OpenFGA gate.
- CAIPE_AGENT_CONTEXT_HMAC_SECRET=${CAIPE_AGENT_CONTEXT_HMAC_SECRET:-}
# Connections & Secrets credential exchange. Disabled by default; when
# USE_IMPERSONATION_TOKENS=true, DA resolves MCP credential refs via the
# server-to-server credential API instead of browser/session cookies.
- CAIPE_CREDENTIALS_ENABLED=${CAIPE_CREDENTIALS_ENABLED:-false}
- CREDENTIAL_API_URL=${CREDENTIAL_API_URL:-http://caipe-ui:3000/api/credentials}
- CAIPE_API_URL=${CAIPE_API_URL:-http://caipe-ui:3000}
# Browser-reachable Grid URL for workflow run links returned by workflow tools.
- CAIPE_UI_PUBLIC_URL=${CAIPE_UI_PUBLIC_URL:-${CAIPE_UI_BASE_URL:-${NEXTAUTH_URL:-http://localhost:3000}}}
# WorkflowApiClient (builtin start_workflow_run / list / status tools) calls the
# BFF /api/workflow-runs* routes. When SSO_ENABLED=true on the UI, those routes
# require a Bearer JWT — client_credentials against Keycloak (not the caller's OBO).
- OAUTH2_TOKEN_URL=${OAUTH2_TOKEN_URL:-http://keycloak:7080/realms/caipe/protocol/openid-connect/token}
- OAUTH2_CLIENT_ID=${OAUTH2_CLIENT_ID:-caipe-platform}
- OAUTH2_CLIENT_SECRET=${OAUTH2_CLIENT_SECRET:-caipe-platform-dev-secret}
- OAUTH2_SCOPE=${OAUTH2_SCOPE:-}
- OAUTH2_AUDIENCE=${OAUTH2_AUDIENCE:-}
- CREDENTIAL_SERVICE_AUDIENCE=${CREDENTIAL_SERVICE_AUDIENCE:-caipe-credential-service}
- USE_IMPERSONATION_TOKENS=${USE_IMPERSONATION_TOKENS:-false}
# Persist conversation history across /invoke calls (ephemeral by default).
# Required for the chat-as-sa.sh script and any non-streaming caller that
# expects multi-turn context.
- INVOKE_PERSIST_HISTORY=${INVOKE_PERSIST_HISTORY:-false}
# Static service-account fallback for shared-token MCP servers (GitHub/GitLab).
# When a caller has NOT connected their personal provider account, DA injects
# these org PATs on X-CAIPE-Provider-Token so those tools stay backward
# compatible. Connected users always get their own OAuth token instead.
- GITHUB_PERSONAL_ACCESS_TOKEN=${GITHUB_PERSONAL_ACCESS_TOKEN:-}
- GITLAB_PERSONAL_ACCESS_TOKEN=${GITLAB_PERSONAL_ACCESS_TOKEN:-${GITLAB_TOKEN:-}}
# Spec 102 Phase 11.4 — require Bearer JWT on every DA request.
# The BFF (ui/src/lib/da-proxy.ts and the two probe / suggest routes)
# now always sends Authorization: Bearer alongside the legacy
# X-User-Context header. Set DA_REQUIRE_BEARER=false to roll back if
# an unmigrated caller is discovered in production.
- DA_REQUIRE_BEARER=${DA_REQUIRE_BEARER:-true}