-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yaml
102 lines (95 loc) · 2.52 KB
/
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
services:
# Pretty much copy pasted from
# https://www.ory.sh/docs/hydra/5min-tutorial
# https://github.com/ory/hydra/blob/master/quickstart.yml
#
# I only removed the consent service as we don't use it.
hydra:
image: oryd/hydra:v2.2.0
ports:
- "4444:4444" # Public port
- "4445:4445" # Admin port
command: serve -c /etc/config/hydra/hydra.yml all --dev
volumes:
- hydra-sqlite:/var/lib/sqlite:Z
- ./docker/hydra-config:/etc/config/hydra:Z
environment:
DSN: "sqlite:///var/lib/sqlite/db.sqlite?_fk=true"
URLS_SELF_ISSUER: "http://127.0.0.1:4444"
restart: unless-stopped
depends_on:
- hydra-migrate
networks:
- hydra
hydra-migrate:
image: oryd/hydra:v2.2.0
environment:
DSN: "sqlite:///var/lib/sqlite/db.sqlite?_fk=true"
command: migrate -c /etc/config/hydra/hydra.yml sql -e --yes
volumes:
- hydra-sqlite:/var/lib/sqlite:Z
- ./docker/hydra-config:/etc/config/hydra:Z
restart: on-failure
networks:
- hydra
# Adding a second hydra to act as a different OAuth2 provider
hydra-2:
image: oryd/hydra:v2.2.0
ports:
- "4454:4454" # Public port
- "4455:4455" # Admin port
command: serve -c /etc/config/hydra/hydra.yml all --dev
volumes:
- hydra-2-sqlite:/var/lib/sqlite:Z
- ./docker/hydra-config:/etc/config/hydra:Z
environment:
DSN: "sqlite:///var/lib/sqlite/db.sqlite?_fk=true"
URLS_SELF_ISSUER: "http://127.0.0.1:4454"
SERVE_PUBLIC_PORT: "4454"
SERVE_ADMIN_PORT: "4455"
restart: unless-stopped
depends_on:
- hydra-migrate
networks:
- hydra-2
hydra-2-migrate:
image: oryd/hydra:v2.2.0
environment:
DSN: "sqlite:///var/lib/sqlite/db.sqlite?_fk=true"
command: migrate -c /etc/config/hydra/hydra.yml sql -e --yes
volumes:
- hydra-2-sqlite:/var/lib/sqlite:Z
- ./docker/hydra-config:/etc/config/hydra:Z
restart: on-failure
networks:
- hydra-2
nats:
image: nats
ports:
- "4222:4222"
- "8222:8222"
command: >
--jetstream
--http_port=8222
--user=grafbase
--pass=grafbase
networks: ["nats"]
postgres:
image: postgres:17
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: grafbase
ports:
- "5432:5432"
command: postgres -c 'max_connections=200'
networks: ["postgres"]
restart: unless-stopped
networks:
hydra:
hydra-2:
nats:
postgres:
volumes:
hydra-sqlite:
hydra-2-sqlite:
postgres-data: