-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.dev.yml
154 lines (154 loc) · 4.46 KB
/
docker-compose.dev.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
version: '3.7'
services:
kratos-migrate:
image: ghcr.io/canonical/kratos:1.1.0
environment:
- DSN=postgres://kratos:kratos@postgres/kratos?sslmode=disable
volumes:
- type: volume
source: kratos-sqlite
target: /var/lib/sqlite
read_only: false
- type: bind
source: ./docker/kratos
target: /etc/config/kratos
command: exec kratos -c /etc/config/kratos/kratos.yml migrate sql -e --yes
restart: on-failure
networks:
- intranet
kratos:
depends_on:
- kratos-migrate
image: ghcr.io/canonical/kratos:1.1.0
container_name: kratos
ports:
- '4433:4433' # public
- '4434:4434' # admin
restart: unless-stopped
environment:
- DSN=postgres://kratos:kratos@postgres/kratos?sslmode=disable
- LOG_LEVEL=trace
- SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS_0_CLIENT_ID=${CLIENT_ID}
- SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS_0_CLIENT_SECRET=${CLIENT_SECRET}
command: exec kratos serve -c /etc/config/kratos/kratos.yml --dev --watch-courier
volumes:
- type: volume
source: kratos-sqlite
target: /var/lib/sqlite
read_only: false
- type: bind
source: ./docker/kratos
target: /etc/config/kratos
networks:
- intranet
kratos-setup:
image: ghcr.io/canonical/kratos:1.1.0
depends_on:
- kratos
restart: "no"
volumes:
- type: volume
source: kratos-sqlite
target: /var/lib/sqlite
read_only: false
- type: bind
source: ./docker/kratos
target: /etc/config/kratos
command: exec kratos import identities /etc/config/kratos/identity.json --endpoint http://kratos:4434
networks:
- intranet
hydra:
image: ghcr.io/canonical/hydra:2.2.0-canonical
ports:
- "4444:4444" # Public port
- "4445:4445" # Admin port
command: exec hydra serve -c /etc/config/hydra/hydra.yml all --dev
volumes:
- type: bind
source: ./docker/hydra
target: /etc/config/hydra
environment:
- DSN=postgres://hydra:hydra@postgres/hydra?sslmode=disable
- CORS_DEBUG=1
restart: unless-stopped
depends_on:
- hydra-migrate
networks:
- intranet
hydra-migrate:
image: ghcr.io/canonical/hydra:2.2.0-canonical
environment:
- DSN=postgres://hydra:hydra@postgres/hydra?sslmode=disable
command: exec hydra migrate -c /etc/config/hydra/hydra.yml sql -e --yes
volumes:
- type: bind
source: ./docker/hydra
target: /etc/config/hydra
restart: on-failure
networks:
- intranet
mailslurper:
image: oryd/mailslurper:latest-smtps
ports:
- '4436:4436'
- '4437:4437'
networks:
- intranet
postgres:
image: postgres
container_name: postgres
restart: always
ports:
- 5432:5432
volumes:
- ./docker/postgres/init-database.sql:/docker-entrypoint-initdb.d/init-database.sql
environment:
POSTGRES_USER: openfga
POSTGRES_PASSWORD: openfga
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U openfga" ]
interval: 5s
timeout: 5s
retries: 5
networks:
- intranet
migrateopenfga:
image: openfga/openfga:latest
container_name: migrateopenfga
command: migrate --datastore-engine postgres --datastore-uri 'postgresql://openfga:openfga@postgres/openfga?sslmode=disable'
depends_on:
postgres:
condition: service_healthy
networks:
- intranet
insert-hardcoded-store:
image: governmentpaas/psql
container_name: insert-hardcoded-store
command: psql -Atx postgresql://openfga:openfga@postgres/openfga?sslmode=disable -c "INSERT INTO store (id,name,created_at,updated_at) VALUES ('01GP1254CHWJC1MNGVB0WDG1T0','login-ui',NOW(),NOW()) ON CONFLICT DO NOTHING;"
depends_on:
migrateopenfga:
condition: service_completed_successfully
networks:
- intranet
openfga:
image: openfga/openfga:latest
environment:
OPENFGA_DATASTORE_ENGINE: "postgres"
OPENFGA_DATASTORE_URI: "postgresql://openfga:openfga@postgres/openfga?sslmode=disable"
OPENFGA_AUTHN_PRESHARED_KEYS: "42"
command: run
ports:
- 8080:8080
- 8081:8081
- 3000:3000
depends_on:
migrateopenfga:
condition: service_completed_successfully
insert-hardcoded-store:
condition: service_completed_successfully
networks:
- intranet
networks:
intranet:
volumes:
kratos-sqlite: