@@ -2,13 +2,23 @@ services:
2
2
hydra :
3
3
image : oryd/hydra:v2.2
4
4
command : serve public --dev -c /etc/config/hydra/hydra.yml
5
- volumes :
6
- - .docker/hydra:/etc/config/hydra:ro
5
+ configs :
6
+ - source : hydra_config
7
+ target : /etc/config/hydra/hydra.yml
7
8
environment :
8
- - DSN=postgres://hydra:secret@hydra-postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4
9
- env_file :
10
- - .env.production
11
- - .env
9
+ - LOG_LEVEL=${HYDRA_LOG_LEVEL:-warn}
10
+ - LOG_FORMAT=${HYDRA_LOG_FORMAT:-json}
11
+ - DSN=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@hydra-postgresd:5432/${POSTGRES_DB}?sslmode=disable&max_conns=20&max_idle_conns=4
12
+ - URLS_SELF_ISSUER=${URLS_SELF_ISSUER:-http://localhost:4444/}
13
+ - URLS_SELF_PUBLIC=${URLS_SELF_PUBLIC:-http://localhost:4444/}
14
+ - URLS_LOGIN=${URLS_LOGIN}
15
+ - URLS_REGISTRATION=${URLS_REGISTRATION}
16
+ - URLS_CONSENT=${URLS_CONSENT}
17
+ - URLS_LOGOUT=${URLS_LOGOUT}
18
+ - URLS_ERROR=${URLS_ERROR}
19
+ - OIDC_SUBJECT_IDENTIFIERS_PAIRWISE_SALT=${OIDC_SUBJECT_IDENTIFIERS_PAIRWISE_SALT}
20
+ - SECRETS_COOKIE=${SECRETS_COOKIE}
21
+ - SECRETS_SYSTEM=${SECRETS_SYSTEM}
12
22
restart : unless-stopped
13
23
depends_on :
14
24
- hydra-migrate
@@ -17,43 +27,61 @@ services:
17
27
hydra-admin :
18
28
image : oryd/hydra:v2.2
19
29
command : serve admin -c /etc/config/hydra/hydra.yml
20
- ports :
21
- - 4445:4445
22
- volumes :
23
- - .docker/hydra:/etc/config/hydra:ro
30
+ configs :
31
+ - source : hydra_config
32
+ target : /etc/config/hydra/hydra.yml
24
33
environment :
25
- - DSN=postgres://hydra:secret@hydra-postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4
26
- env_file :
27
- - .env.production
28
- - .env
34
+ - LOG_LEVEL=${HYDRA_LOG_LEVEL:-warn}
35
+ - LOG_FORMAT=${HYDRA_LOG_FORMAT:-json}
36
+ - DSN=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@hydra-postgresd:5432/${POSTGRES_DB}?sslmode=disable&max_conns=20&max_idle_conns=4
37
+ - URLS_SELF_ISSUER=${URLS_SELF_ISSUER:-http://localhost:4444/}
38
+ - URLS_SELF_PUBLIC=${URLS_SELF_PUBLIC:-http://localhost:4444/}
39
+ - URLS_LOGIN=${URLS_LOGIN}
40
+ - URLS_REGISTRATION=${URLS_REGISTRATION}
41
+ - URLS_CONSENT=${URLS_CONSENT}
42
+ - URLS_LOGOUT=${URLS_LOGOUT}
43
+ - URLS_ERROR=${URLS_ERROR}
44
+ - OIDC_SUBJECT_IDENTIFIERS_PAIRWISE_SALT=${OIDC_SUBJECT_IDENTIFIERS_PAIRWISE_SALT}
45
+ - SECRETS_COOKIE=${SECRETS_COOKIE}
46
+ - SECRETS_SYSTEM=${SECRETS_SYSTEM}
29
47
restart : unless-stopped
30
48
depends_on :
31
49
- hydra-migrate
32
50
- hydra-postgresd
33
51
34
52
hydra-migrate :
35
53
image : oryd/hydra:v2.2
54
+ command : migrate -c /etc/config/hydra/hydra.yml sql -e --yes
55
+ configs :
56
+ - source : hydra_config
57
+ target : /etc/config/hydra/hydra.yml
36
58
depends_on :
37
59
- hydra-postgresd
38
60
environment :
39
- - DSN=postgres://hydra:secret@hydra-postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4
40
- env_file :
41
- - .env.production
42
- - .env
43
- command : migrate -c /etc/config/hydra/hydra.yml sql -e --yes
44
- volumes :
45
- - .docker/hydra:/etc/config/hydra:ro
61
+ - LOG_LEVEL=${HYDRA_LOG_LEVEL:-warn}
62
+ - LOG_FORMAT=${HYDRA_LOG_FORMAT:-json}
63
+ - DSN=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@hydra-postgresd:5432/${POSTGRES_DB}?sslmode=disable&max_conns=20&max_idle_conns=4
64
+ - URLS_SELF_ISSUER=${URLS_SELF_ISSUER:-http://localhost:4444/}
65
+ - URLS_SELF_PUBLIC=${URLS_SELF_PUBLIC:-http://localhost:4444/}
66
+ - URLS_LOGIN=${URLS_LOGIN}
67
+ - URLS_REGISTRATION=${URLS_REGISTRATION}
68
+ - URLS_CONSENT=${URLS_CONSENT}
69
+ - URLS_LOGOUT=${URLS_LOGOUT}
70
+ - URLS_ERROR=${URLS_ERROR}
71
+ - OIDC_SUBJECT_IDENTIFIERS_PAIRWISE_SALT=${OIDC_SUBJECT_IDENTIFIERS_PAIRWISE_SALT}
72
+ - SECRETS_COOKIE=${SECRETS_COOKIE}
73
+ - SECRETS_SYSTEM=${SECRETS_SYSTEM}
46
74
restart : on-failure
47
75
48
76
hydra-postgresd :
49
77
image : postgres:16
50
78
restart : always
51
79
volumes :
52
- - hdyra_db_data :/var/lib/postgresql/data
80
+ - hydra_db_data :/var/lib/postgresql/data
53
81
environment :
54
- - POSTGRES_USER=hydra
55
- - POSTGRES_PASSWORD=secret
56
- - POSTGRES_DB=hydra
82
+ - POSTGRES_USER=${POSTGRES_USER}
83
+ - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
84
+ - POSTGRES_DB=${POSTGRES_DB}
57
85
healthcheck :
58
86
test : ["CMD-SHELL", "pg_isready"]
59
87
interval : 10s
@@ -64,13 +92,18 @@ services:
64
92
image : oryd/oathkeeper:v0.40
65
93
depends_on :
66
94
- hydra
67
- ports :
68
- - 4455:4455
69
- command :
70
- serve proxy -c "/etc/config/oathkeeper/oathkeeper.yml"
95
+ - hydra-login-consent
96
+ command : serve proxy -c "/etc/config/oathkeeper/oathkeeper.yml"
97
+ configs :
98
+ - source : oathkeeper_config
99
+ target : /etc/config/oathkeeper/oathkeeper.yml
100
+ - source : oathkeeper_rules
101
+ target : /etc/config/oathkeeper/access-rules.yml
102
+ environment :
103
+ - LOG_LEVEL=${OATHKEEPER_LOG_LEVEL:-warn}
104
+ - LOG_FORMAT=${OATHKEEPER_LOG_FORMAT:-json}
105
+ - SERVE_PROXY_PORT=${SERVE_PROXY_PORT:-4455}
71
106
restart : on-failure
72
- volumes :
73
- - .docker/oathkeeper:/etc/config/oathkeeper:ro
74
107
75
108
hydra-login-consent :
76
109
build :
@@ -82,5 +115,22 @@ services:
82
115
depends_on :
83
116
- hydra-admin
84
117
118
+ hydra-cleanup :
119
+ build :
120
+ context : ./hydra-cleanup
121
+ environment :
122
+ - HYDRA_ADMIN_URL=http://hydra-admin:4445
123
+ restart : on-failure
124
+ depends_on :
125
+ - hydra-admin
126
+
127
+ configs :
128
+ hydra_config :
129
+ file : .docker/hydra/hydra.yml
130
+ oathkeeper_config :
131
+ file : .docker/oathkeeper/oathkeeper.yml
132
+ oathkeeper_rules :
133
+ file : .docker/oathkeeper/access-rules.yml
134
+
85
135
volumes :
86
- hdyra_db_data :
136
+ hydra_db_data :
0 commit comments