@@ -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,63 @@ 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
81
+ ports :
82
+ - 5432:5432
53
83
environment :
54
- - POSTGRES_USER=hydra
55
- - POSTGRES_PASSWORD=secret
56
- - POSTGRES_DB=hydra
84
+ - POSTGRES_USER=${POSTGRES_USER}
85
+ - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
86
+ - POSTGRES_DB=${POSTGRES_DB}
57
87
healthcheck :
58
88
test : ["CMD-SHELL", "pg_isready"]
59
89
interval : 10s
@@ -64,13 +94,19 @@ services:
64
94
image : oryd/oathkeeper:v0.40
65
95
depends_on :
66
96
- hydra
67
- ports :
68
- - 4455:4455
69
- command :
70
- serve proxy -c "/etc/config/oathkeeper/oathkeeper.yml"
97
+ - hydra-login-consent
98
+ command : serve proxy -c "/etc/config/oathkeeper/oathkeeper.yml"
99
+ configs :
100
+ - source : oathkeeper_config
101
+ target : /etc/config/oathkeeper/oathkeeper.yml
102
+ - source : oathkeeper_rules
103
+ target : /etc/config/oathkeeper/access-rules.yml
104
+ environment :
105
+ - LOG_LEVEL=${OATHKEEPER_LOG_LEVEL:-warn}
106
+ - LOG_FORMAT=${OATHKEEPER_LOG_FORMAT:-json}
107
+ - SERVE_PROXY_PORT=${SERVE_PROXY_PORT:-4455}
108
+ - SERVE_PROXY_CORS_ALLOWED_ORIGINS=${SERVE_PROXY_CORS_ALLOWED_ORIGINS}
71
109
restart : on-failure
72
- volumes :
73
- - .docker/oathkeeper:/etc/config/oathkeeper:ro
74
110
75
111
hydra-login-consent :
76
112
build :
@@ -82,5 +118,13 @@ services:
82
118
depends_on :
83
119
- hydra-admin
84
120
121
+ configs :
122
+ hydra_config :
123
+ file : .docker/hydra/hydra.yml
124
+ oathkeeper_config :
125
+ file : .docker/oathkeeper/oathkeeper.yml
126
+ oathkeeper_rules :
127
+ file : .docker/oathkeeper/access-rules.yml
128
+
85
129
volumes :
86
- hdyra_db_data :
130
+ hydra_db_data :
0 commit comments