-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
337 lines (306 loc) · 11.2 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
version: "3.8"
services:
traefik:
image: traefik
restart: unless-stopped
networks:
- traefik-public
- intranet
labels: &labels
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.http.routers.traefik.rule=Host(`traefik.ory.localhost`)
- traefik.http.routers.traefik.entrypoints=https
- traefik.http.routers.traefik.tls=true
- traefik.http.routers.traefik.service=api@internal
- traefik.http.routers.traefik-metrics.rule=(Host(`traefik.ory.localhost`) || Host(`traefik`)) && Path(`/metrics`)
- traefik.http.routers.traefik-metrics.entrypoints=https
- traefik.http.routers.traefik-metrics.tls=true
- traefik.http.routers.traefik-metrics.service=prometheus@internal
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- target: 443
published: 443
mode: host
- target: 50000
published: 50000
mode: host
command:
- --global.sendAnonymousUsage=false
- --serverstransport.insecureskipverify=true
- --providers.docker
- --providers.docker.exposedbydefault=false
- --entrypoints.https.address=:443
- --entrypoints.spicedb.address=:50000
- --accesslog
- --log
- --log.level=debug
- --api
- --api.dashboard
- --metrics.prometheus
- --metrics.prometheus.entrypoint=http
- --metrics.prometheus.manualrouting
prometheus:
image: quay.io/prometheus/prometheus
restart: unless-stopped
networks:
- traefik-public
- intranet
volumes:
- ./config/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- /var/run/docker.sock:/var/run/docker.sock:ro
- prometheus_data:/prometheus
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.http.routers.prometheus.rule=Host(`prometheus.ory.localhost`)
- traefik.http.routers.prometheus.entrypoints=https
- traefik.http.routers.prometheus.tls=true
grafana:
image: grafana/grafana
restart: unless-stopped
networks:
- traefik-public
volumes:
- grafana_data:/var/lib/grafana
- ./config/grafana/provisioning/:/etc/grafana/provisioning/
labels:
- traefik.enable=true
- traefik.http.routers.grafana.rule=Host(`grafana.ory.localhost`)
- traefik.http.routers.grafana.entrypoints=https
- traefik.http.routers.grafana.tls=true
whoami:
image: traefik/whoami
networks:
- traefik-public
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.http.routers.whoami.rule=Host(`whoami.ory.localhost`)
- traefik.http.routers.whoami.entrypoints=https
- traefik.http.routers.whoami.tls=true
- traefik.http.routers.whoami.middlewares=oathkeeper
postgres-kratos:
image: postgres:9.6
environment:
- POSTGRES_USER=kratos
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=kratos
networks:
- intranet
kratos-migrate:
image: oryd/kratos:v0.9.0-alpha.3
links:
- postgres-kratos:postgres-kratos
environment:
- DSN=postgres://kratos:secret@postgres-kratos:5432/kratos?sslmode=disable&max_conns=20&max_idle_conns=4
networks:
- intranet
volumes:
- ./config/kratos:/etc/config/kratos
command: -c /etc/config/kratos/kratos.yml migrate sql -e --yes
kratos:
image: oryd/kratos:v0.9.0-alpha.3
depends_on:
- kratos-migrate
links:
- postgres-kratos:postgres-kratos
volumes:
- ./config/kratos:/etc/config/kratos
networks:
- intranet
- traefik-public
command: serve -c /etc/config/kratos/kratos.yml --watch-courier
environment:
- DSN=postgres://kratos:secret@postgres-kratos:5432/kratos?sslmode=disable&max_conns=20&max_idle_conns=4
- LOG_LEVEL=trace
- SERVE_PUBLIC_BASE_URL=https://kratos.ory.localhost/
# - SERVE_PUBLIC_BASE_URL=http://kratos.ory.localhost:9000/
# - SERVE_PUBLIC_BASE_URL=http://ui.ory.localhost:9000/.ory/kratos/public/
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.http.routers.kratos.rule=Host(`kratos.ory.localhost`) || (Host(`ui.ory.localhost`) && PathPrefix(`/.ory/kratos/public/`))
- traefik.http.middlewares.kratos-strip.stripprefix.prefixes=/.ory/kratos/public/
- traefik.http.routers.kratos.entrypoints=https
- traefik.http.routers.kratos.tls=true
# - traefik.http.routers.kratos.middlewares=oathkeeper,kratos-strip
- traefik.http.routers.kratos.service=kratos
- traefik.http.services.kratos.loadbalancer.server.port=4433
- traefik.http.routers.kratos-admin.rule=Host(`kratos-admin.ory.localhost`)
- traefik.http.routers.kratos-admin.entrypoints=https
- traefik.http.routers.kratos-admin.tls=true
- traefik.http.routers.kratos-admin.service=kratos-admin
- traefik.http.routers.kratos-admin.middlewares=oathkeeper
- traefik.http.services.kratos-admin.loadbalancer.server.port=4434
ui:
environment:
# - SECURITY_MODE=jwks
# - JWKS_URL=http://oathkeeper:4456/.well-known/jwks.json
- KRATOS_BROWSER_URL=https://kratos.ory.localhost/
# - KRATOS_BROWSER_URL=http://kratos.ory.localhost:9000/
# - KRATOS_BROWSER_URL=http://ui.ory.localhost:9000/.ory/kratos/public
- KRATOS_PUBLIC_URL=http://kratos:4433/
image: oryd/kratos-selfservice-ui-node:v0.9.0-alpha.3
networks:
- intranet
- traefik-public
restart: on-failure
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.http.routers.ui.rule=Host(`ui.ory.localhost`) && !PathPrefix(`/.ory/kratos/public/`)
- traefik.http.routers.ui.entrypoints=https
- traefik.http.routers.ui.tls=true
- traefik.http.routers.ui.middlewares=oathkeeper
oathkeeper:
image: oryd/oathkeeper:v0.38
depends_on:
- kratos
command:
serve proxy -c "/etc/config/oathkeeper/oathkeeper.yml"
environment:
- LOG_LEVEL=debug
restart: on-failure
networks:
- intranet
- traefik-public
volumes:
- ./config/oathkeeper:/etc/config/oathkeeper
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.http.routers.oathkeeper-proxy.rule=Host(`oathkeeper-proxy.ory.localhost`)
- traefik.http.routers.oathkeeper-proxy.entrypoints=https
- traefik.http.routers.oathkeeper-proxy.tls=true
- traefik.http.routers.oathkeeper-proxy.service=oathkeeper-proxy
- traefik.http.services.oathkeeper-proxy.loadbalancer.server.port=4455
- traefik.http.routers.oathkeeper-api.rule=Host(`oathkeeper-api.ory.localhost`)
- traefik.http.routers.oathkeeper-api.entrypoints=https
- traefik.http.routers.oathkeeper-api.tls=true
- traefik.http.routers.oathkeeper-api.service=oathkeeper-api
- traefik.http.services.oathkeeper-api.loadbalancer.server.port=4456
- traefik.http.middlewares.oathkeeper.forwardauth.address=http://oathkeeper:4456/decisions
# - traefik.http.middlewares.oathkeeper.forwardauth.authResponseHeadersRegex=^X-
- traefik.http.middlewares.oathkeeper.forwardauth.authResponseHeaders=X-User,X-Email
mailslurper:
image: oryd/mailslurper:latest-smtps
# ports:
# - '4436:4436'
# - '4437:4437'
networks:
- intranet
postgres-keto:
image: postgres:9.6
environment:
- POSTGRES_USER=keto
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=keto
networks:
- intranet
keto-migrate:
image: oryd/keto:v0.8
volumes:
- ./config/keto:/home/ory
environment:
- LOG_LEVEL=debug
- DSN=postgres://keto:secret@postgres-keto:5432/keto?sslmode=disable&max_conns=20&max_idle_conns=4
command: ["migrate", "up", "-y"]
restart: on-failure
depends_on:
- postgres-kratos
networks:
- intranet
keto-perms:
image: oryd/keto:v0.8
volumes:
- ./config/keto:/home/ory
environment:
- KETO_WRITE_REMOTE=keto:4467
- KETO_READ_REMOTE=keto:4466
- LOG_LEVEL=debug
- DSN=postgres://keto:secret@postgres-keto:5432/keto?sslmode=disable&max_conns=20&max_idle_conns=4
depends_on:
- postgres-kratos
networks:
- intranet
keto:
image: oryd/keto:v0.8
volumes:
- ./config/keto:/home/ory
depends_on:
- keto-migrate
environment:
- DSN=postgres://keto:secret@postgres-keto:5432/keto?sslmode=disable&max_conns=20&max_idle_conns=4
networks:
- intranet
- traefik-public
command: serve
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.http.routers.keto-read.rule=Host(`keto-read.ory.localhost`)
- traefik.http.routers.keto-read.entrypoints=https
- traefik.http.routers.keto-read.tls=true
- traefik.http.routers.keto-read.service=keto-read
- traefik.http.services.keto-read.loadbalancer.server.port=4466
- traefik.http.routers.keto-write.rule=Host(`keto-write.ory.localhost`)
- traefik.http.routers.keto-write.entrypoints=https
- traefik.http.routers.keto-write.tls=true
- traefik.http.routers.keto-write.service=keto-write
- traefik.http.services.keto-write.loadbalancer.server.port=4467
spicedb:
image: authzed/spicedb
networks:
- intranet
- traefik-public
command: serve --grpc-preshared-key "blah" --http-enabled
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.tcp.routers.spicedb-grpc
- traefik.tcp.routers.spicedb-grpc.rule=HostSNI(`*`)
- traefik.tcp.routers.spicedb-grpc.entrypoints=spicedb
- traefik.tcp.routers.spicedb-grpc.service=spicedb-grpc
- traefik.tcp.services.spicedb-grpc.loadbalancer.server.port=50051
- traefik.http.routers.spicedb-http.rule=Host(`spicedb-http.ory.localhost`)
- traefik.http.routers.spicedb-http.entrypoints=https
- traefik.http.routers.spicedb-http.tls=true
- traefik.http.routers.spicedb-http.service=spicedb-http
- traefik.http.services.spicedb-http.loadbalancer.server.port=8443
- traefik.http.routers.spicedb-dashboard.rule=Host(`spicedb-dashboard.ory.localhost`)
- traefik.http.routers.spicedb-dashboard.entrypoints=https
- traefik.http.routers.spicedb-dashboard.tls=true
- traefik.http.routers.spicedb-dashboard.service=spicedb-dashboard
- traefik.http.services.spicedb-dashboard.loadbalancer.server.port=8080
- traefik.http.routers.spicedb-metrics.rule=Host(`spicedb-metrics.ory.localhost`)
- traefik.http.routers.spicedb-metrics.entrypoints=https
- traefik.http.routers.spicedb-metrics.tls=true
- traefik.http.routers.spicedb-metrics.service=spicedb-metrics
- traefik.http.services.spicedb-metrics.loadbalancer.server.port=9090
# postgres-shorts:
# image: postgres:9.6
# ports:
# - "5432:5432"
# environment:
# - POSTGRES_USER=shorts
# - POSTGRES_PASSWORD=notsecureatall
# - POSTGRES_DB=shorts
# networks:
# - intranet
#
# shorts:
# build:
# context: .
# env_file: .env
#
# networks:
# - intranet
volumes:
# kratos-sqlite:
grafana_data: {}
prometheus_data: {}
networks:
intranet: {}
traefik-public: {}