-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.demo.yml
More file actions
169 lines (158 loc) · 4 KB
/
Copy pathdocker-compose.demo.yml
File metadata and controls
169 lines (158 loc) · 4 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
# Demo compose file with Keycloak SSO for WorkOS Admin Portal testing
# Usage: docker compose -f docker-compose.demo.yml up
#
# Access points:
# - Frontend: http://localhost:5001
# - Keycloak Admin: http://localhost:8080
# - Keycloak login: admin / admin
services:
ai_service:
image: governance-agent-ai_service:latest
build:
context: .
dockerfile: ai.dockerfile
ports:
- "5000:8000"
env_file:
- .env
environment:
- PYTHONPATH=/app/src
depends_on:
vector_db:
condition: service_started
restart: unless-stopped
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8000/health')",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
frontend:
image: governance-agent-frontend:latest
build:
context: .
dockerfile: next.dockerfile
ports:
- "5001:3000"
env_file:
- .env
environment:
- NODE_ENV=production
- AI_SERVICE_URL=http://ai_service:8000
- POSTGRES_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD}@application_db:5432/${POSTGRES_DB:-app_db}
depends_on:
ai_service:
condition: service_started
application_db:
condition: service_healthy
keycloak:
condition: service_healthy
restart: unless-stopped
vector_db:
image: qdrant/qdrant:latest
restart: unless-stopped
container_name: qdrant_demo
ports:
- "6333:6333"
- "6334:6334"
expose:
- 6333
- 6334
- 6335
configs:
- source: qdrant_config
target: /qdrant/config/production.yaml
volumes:
- qdrant_demo_data:/qdrant/storage
application_db:
image: postgres:15
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
POSTGRES_DB: ${POSTGRES_DB:-app_db}
ports:
- "5432:5432"
volumes:
- db_demo_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
# Keycloak SSO Service for WorkOS Demo
keycloak_db:
image: postgres:15
restart: always
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: keycloak_password
volumes:
- keycloak_db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U keycloak"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
keycloak:
image: quay.io/keycloak/keycloak:23.0
container_name: keycloak_demo
command: start-dev
restart: unless-stopped
environment:
# Admin credentials
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
# Database configuration
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://keycloak_db:5432/keycloak
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: keycloak_password
# Server configuration
KC_HOSTNAME_STRICT: false
KC_HOSTNAME_STRICT_HTTPS: false
KC_HTTP_ENABLED: true
KC_HEALTH_ENABLED: true
KC_METRICS_ENABLED: true
# Proxy settings
KC_PROXY: edge
KC_LOG_LEVEL: INFO
ports:
- "8080:8080"
depends_on:
keycloak_db:
condition: service_healthy
healthcheck:
test:
[
"CMD-SHELL",
"exec 3<>/dev/tcp/localhost/8080 && echo -e 'GET /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: 90s
volumes:
- keycloak_data:/opt/keycloak/data
configs:
qdrant_config:
content: |
log_level: INFO
volumes:
db_demo_data:
driver: local
qdrant_demo_data:
driver: local
keycloak_db_data:
driver: local
keycloak_data:
driver: local