-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev-compose.yaml
269 lines (265 loc) · 9.01 KB
/
dev-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# Copyright (C) 2023 Univention GmbH
#
# SPDX-License-Identifier: AGPL-3.0-only
services:
proxy:
image: traefik:v2.11
hostname: traefik
command:
- --providers.docker=true
- --entryPoints.web.address=:80
- --api.insecure=true
networks:
- proxy-net
ports:
- 80:80
- 8888:8080 # dashboard for troubleshooting
volumes:
- /var/run/docker.sock:/var/run/docker.sock
opa:
container_name: opa-guardian-dev
image: guardian-opa:dev
build: opa/
networks:
- proxy-net
environment:
- OPA_DATA_BUNDLE
- OPA_POLICY_BUNDLE
- OPA_GUARDIAN_MANAGEMENT_URL
- OPA_POLLING_MIN_DELAY
- OPA_POLLING_MAX_DELAY
labels:
traefik.http.routers.opa.entrypoints: web
traefik.http.routers.opa.rule: PathPrefix(`/guardian/opa`)
traefik.http.routers.opa.middlewares: opa-stripprefix
traefik.http.middlewares.opa-stripprefix.stripprefix.prefixes: /guardian/opa
traefik.http.routers.opa.service: opa
traefik.http.services.opa.loadbalancer.server.port: 8181
authorization-api:
container_name: authz-guardian-dev
image: guardian-authorization-api:dev
build:
context: ./
dockerfile: authorization-api/Dockerfile
target: dev
extra_hosts:
- git.knut.univention.de:${GITLAB_IP}
- ucs-sso-ng.school.test:${UCS_HOST_IP}
extra_hosts:
- ucs-sso-ng.school.test:${UCS_HOST_IP}
depends_on:
opa:
condition: service_started
proxy:
condition: service_started
keycloak-provisioning:
condition: service_completed_successfully
networks:
- proxy-net
volumes:
- ./authorization-api:/app/authorization-api
- type: bind
source: ./management_service_dir
target: /guardian_service_dir
environment:
- GUARDIAN__AUTHZ__CORS__ALLOWED_ORIGINS
- GUARDIAN__AUTHZ__LOGGING__LEVEL
- GUARDIAN__AUTHZ__LOGGING__STRUCTURED
- GUARDIAN__AUTHZ__ADAPTER__SETTINGS_PORT
- GUARDIAN__AUTHZ__ADAPTER__PERSISTENCE_PORT
- GUARDIAN__AUTHZ__ADAPTER__POLICY_PORT
- GUARDIAN__AUTHZ__ADAPTER__AUTHENTICATION_PORT
- GUARDIAN__AUTHZ__API_PREFIX
- UDM_DATA_ADAPTER__USERNAME
- UDM_DATA_ADAPTER__PASSWORD
- UDM_DATA_ADAPTER__URL
- OPA_ADAPTER__URL
- OAUTH_ADAPTER__WELL_KNOWN_URL
- REQUESTS_CA_BUNDLE
- SSL_CERT_FILE
labels:
traefik.http.routers.authz.entrypoints: web
traefik.http.routers.authz.rule: PathPrefix(`/guardian/authorization`)
traefik.http.routers.authz.service: authz
traefik.http.services.authz.loadbalancer.server.port: 8000
db_provisioning:
container_name: db_provisioning
image: guardian-management-api:dev
entrypoint: alembic
command: upgrade head
user: ${USER_ID:-1000}
working_dir: /app/management-api
build:
context: ./
dockerfile: management-api/Dockerfile
target: dev
extra_hosts:
- git.knut.univention.de:${GITLAB_IP}
depends_on:
keycloak-provisioning:
condition: service_completed_successfully
db:
condition: service_healthy
volumes:
- ./management-api:/app/management-api
- type: bind
source: ./management_service_dir
target: /guardian_service_dir
labels:
traefik.enable: "false"
environment:
- UCS_HOST_IP
- GUARDIAN__MANAGEMENT__LOGGING__LEVEL
- GUARDIAN__MANAGEMENT__LOGGING__STRUCTURED
- GUARDIAN__MANAGEMENT__ADAPTER__SETTINGS_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__APP_PERSISTENCE_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__CONDITION_PERSISTENCE_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__CONTEXT_PERSISTENCE_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__NAMESPACE_PERSISTENCE_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__PERMISSION_PERSISTENCE_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__ROLE_PERSISTENCE_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__CAPABILITY_PERSISTENCE_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__AUTHENTICATION_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__RESOURCE_AUTHORIZATION_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__AUTHORIZATION_API_URL
- GUARDIAN__MANAGEMENT__BASE_URL
- SQL_PERSISTENCE_ADAPTER__DIALECT
- SQL_PERSISTENCE_ADAPTER__DB_NAME
- OAUTH_ADAPTER__WELL_KNOWN_URL
- REQUESTS_CA_BUNDLE
- SSL_CERT_FILE
networks:
- proxy-net
management-api:
container_name: management-guardian-dev
image: guardian-management-api:dev
user: ${USER_ID:-1000}
build:
context: ./
dockerfile: management-api/Dockerfile
target: dev
extra_hosts:
- git.knut.univention.de:${GITLAB_IP}
extra_hosts:
- ucs-sso-ng.school.test:${UCS_HOST_IP}
depends_on:
db_provisioning:
condition: service_started
proxy:
condition: service_started
keycloak-provisioning:
condition: service_completed_successfully
db:
condition: service_healthy
networks:
- proxy-net
volumes:
- ./management-api:/app/management-api
- type: bind
source: ./management_service_dir
target: /guardian_service_dir
environment:
- UCS_HOST_IP
- GUARDIAN__MANAGEMENT__CORS__ALLOWED_ORIGINS
- GUARDIAN__MANAGEMENT__LOGGING__LEVEL
- GUARDIAN__MANAGEMENT__LOGGING__STRUCTURED
- GUARDIAN__MANAGEMENT__ADAPTER__SETTINGS_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__APP_PERSISTENCE_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__CONDITION_PERSISTENCE_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__CONTEXT_PERSISTENCE_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__NAMESPACE_PERSISTENCE_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__PERMISSION_PERSISTENCE_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__ROLE_PERSISTENCE_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__CAPABILITY_PERSISTENCE_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__AUTHENTICATION_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__RESOURCE_AUTHORIZATION_PORT
- GUARDIAN__MANAGEMENT__ADAPTER__AUTHORIZATION_API_URL
- GUARDIAN__MANAGEMENT__BASE_URL
- SQL_PERSISTENCE_ADAPTER__DIALECT
- SQL_PERSISTENCE_ADAPTER__DB_NAME
- OAUTH_ADAPTER__WELL_KNOWN_URL
- OAUTH_ADAPTER__M2M_SECRET
- REQUESTS_CA_BUNDLE
- SSL_CERT_FILE
labels:
traefik.http.routers.management.entrypoints: web
traefik.http.routers.management.rule: PathPrefix(`/guardian/management`)
traefik.http.routers.management.service: management
traefik.http.services.management.loadbalancer.server.port: 8000
keycloak:
container_name: keycloak-guardian-dev
image: keycloak-guardian:dev
build:
context: ./
dockerfile: keycloak/Dockerfile
hostname: keycloak
command: start --optimized
healthcheck:
test: "/opt/keycloak/bin/kcadm.sh get users -q username=admin --server http://localhost:8080/guardian/keycloak --realm master --user admin --password admin"
interval: 30s
timeout: 10s
retries: 30
start_period: 40s
start_interval: 2s
depends_on:
- proxy
networks:
- proxy-net
labels:
traefik.http.routers.keycloak.entrypoints: web
traefik.http.routers.keycloak.rule: PathPrefix(`/guardian/keycloak`)
traefik.http.routers.keycloak.service: keycloak
traefik.http.services.keycloak.loadbalancer.server.port: 8080
traefik.http.middlewares.customheaders.headers.customrequestheaders.X-Forwarded-Proto: http
traefik.http.routers.keycloak.middlewares: customheaders
keycloak-provisioning:
container_name: keycloak-provisioning-dev
image: keycloak-guardian-provisioning:dev
build:
context: ./
dockerfile: keycloak/provisioning/Dockerfile
depends_on:
keycloak:
condition: service_healthy
networks:
- proxy-net
labels:
traefik.enable: "false"
db:
image: python:3.11.5-alpine
restart: unless-stopped
stop_signal: SIGINT
container_name: dummy-db-service
command: python3 -m http.server
networks:
- proxy-net
healthcheck:
test: ["CMD", "sleep", "0.1"]
management-ui:
container_name: management-ui
image: management-ui:dev
build:
context: ./
dockerfile: management-ui/docker/Dockerfile
extra_hosts:
- git.knut.univention.de:${GITLAB_IP}
depends_on:
keycloak-provisioning:
condition: service_completed_successfully
networks:
- proxy-net
environment:
- VITE__MANAGEMENT_UI__ADAPTER__AUTHENTICATION_PORT=keycloak
- VITE__MANAGEMENT_UI__ADAPTER__DATA_PORT=api
- VITE__KEYCLOAK_AUTHENTICATION_ADAPTER__SSO_URI
- VITE__KEYCLOAK_AUTHENTICATION_ADAPTER__REALM
- VITE__KEYCLOAK_AUTHENTICATION_ADAPTER__CLIENT_ID
- VITE__API_DATA_ADAPTER__URI
labels:
traefik.http.routers.management-ui.entrypoints: web
traefik.http.routers.management-ui.rule: PathPrefix(`/univention/guardian/management-ui`)
traefik.http.routers.management-ui.service: management-ui
traefik.http.services.management-ui.loadbalancer.server.port: 8080
networks:
proxy-net:
name: proxy-net