-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
282 lines (259 loc) · 9.06 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
# SPDX-FileCopyrightText: Magenta ApS <https://magenta.dk>
# SPDX-License-Identifier: MPL-2.0
services:
# We use two images in development.
# * One frontend that runs `vue-cli-service serve`, named `frontend` and
# * One that runs fastapi named `mo`.
# The frontend image proxies requests to fastapi.
# Both of these are served through our nginx proxy.
proxy:
image: nginx:1
volumes:
- ./dev-environment/nginx-proxy.conf.template:/etc/nginx/templates/default.conf.template:ro
ports:
- "127.0.0.1:5001:80"
- "127.0.0.1:5000:80"
restart: unless-stopped
frontend_static:
image: magentaaps/os2mo-frontend:13
environment:
BASE_URL: http://mo:5000
restart: unless-stopped
frontend_new_static:
image: magentaaps/os2mo-naldo:2
environment:
PUBLIC_BASE_URL: http://localhost:5000
PUBLIC_GRAPHQL_VERSION: graphql/v3
ORIGIN: http://localhost:5000
restart: unless-stopped
mo:
# Enabling tty and stdin allows setting a breakpoint() and doing
# `docker attach os2mo-mo-1` to enter pdb. Detach with Ctrl+P Ctrl+Q.
tty: true
stdin_open: true
build: .
# The `volumes` and `command` mounts the backend directory in the docker
# container and overwrites the CMD from Dockerfile. With this gunicorn
# reloads on file changes. This is very useful when developing the backend.
# We also change the Flask app to one where a testing API for testcafe
# e2e-tests is enabled.
volumes:
# Uncomment this with the path you would like to use for queries, and set
# the setting FILE_STORAGE=filesystem
# - /tmp:/queries
# For reload
- ./poetry.lock:/app/poetry.lock
- ./pyproject.toml:/app/pyproject.toml
- ./backend:/app/backend
- ./.pytest_cache:/app/.pytest_cache
- ./.cov-report:/tmp/.cov-report:rw
- ./dev-environment/wait-for-rabbitmq.sh:/wait-for-rabbitmq.sh
entrypoint: ["/wait-for-rabbitmq.sh"]
command: ["./docker/start.sh"]
ports:
- "127.0.0.1:5002:5000"
env_file: dev-environment/os2mo.env
restart: unless-stopped
depends_on:
fixture-loader:
condition: service_completed_successfully
amqp-subsystem:
tty: true
build: .
volumes:
- ./backend:/app/backend
- ./dev-environment/wait-for-rabbitmq.sh:/wait-for-rabbitmq.sh
entrypoint: ["/wait-for-rabbitmq.sh"]
command: ["python", "-m", "mora.cli", "amqp", "start"]
env_file: dev-environment/os2mo.env
restart: unless-stopped
depends_on:
fixture-loader:
condition: service_completed_successfully
mox:
image: nginx:1
volumes:
- ./dev-environment/mox-proxy.conf.template:/etc/nginx/templates/default.conf.template:ro
ports:
- "127.0.0.1:8080:80"
restart: unless-stopped
fixture-loader:
image: magentaaps/os2mo-fixture-loader:1
# For a list of supported fixtures, see:
# https://git.magenta.dk/rammearkitektur/os2mo-fixture-loader.
command: ["${FIXTURE:-kolding}"]
environment:
PGHOST: mox-db
PGDATABASE: mox
PGUSER: postgres
PGPASSWORD: mysecretpassword
# Remove GRACEFUL to overwrite your DB
GRACEFUL: si
restart: on-failure
mo-init:
image: magentaaps/os2mo-init:5
environment:
MO_URL: "http://mo:5000"
CLIENT_ID: "dipex"
CLIENT_SECRET: "603f1c82-d012-4d04-9382-dbe659c533fb"
AUTH_SERVER: "http://keycloak:8080/auth"
AUTH_REALM: "mo"
#volumes:
# - type: bind
# source: ./init.config.yml
# target: /config/config.yml
# read_only: true
restart: on-failure
depends_on:
fixture-loader:
condition: service_completed_successfully
mox-db:
image: postgres:11
environment:
POSTGRES_PASSWORD: mysecretpassword
volumes:
- ./dev-environment/moxdb-install-pgtap.sh:/docker-entrypoint-initdb.d/10-install-pgtap.sh:ro
# The following will mount the database data directory to RAM. It
# significantly speeds up the database at the cost of dataloss on shutdown.
# This is useful for running tests, but should never be used if you want to
# save the data.
# tmpfs:
# - /var/lib/postgresql/data
restart: unless-stopped
mox-db-init:
image: magentaaps/postgres-os2mo:12.2-11.7-test
# build:
# context: ../postgres-os2mo
# dockerfile: docker/Dockerfile
environment:
POSTGRES_HOST: mox-db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: mysecretpassword
DB_NAME: mox
DB_USER: mox
DB_PASSWORD: mox
restart: on-failure
msg-broker:
# Normally, we expect the `rabbitmq` image. The -management images come
# with a set of management plugins installed and enabled by default. They
# can be accessed through the web interface on port 15672. The credentials
# are guest/guest.
image: rabbitmq:3-management
# RabbitMQ stores data based on what it calls the "Node Name", which
# defaults to the hostname. We set this, so we can keep track of our data.
hostname: msg-broker
# We expose the ports here, so decoupled agents can be developed with more
# ease.
ports:
- "127.0.0.1:5672:5672" # amqp port
- "127.0.0.1:15672:15672" # management port
restart: unless-stopped
keycloak:
build:
context: keycloak/
environment:
KC_HOSTNAME_URL: http://localhost:5000/auth
KC_HOSTNAME_ADMIN_URL: http://localhost:5000/auth
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KC_DB_URL_HOST: keycloak-db
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: keycloak
restart: unless-stopped
volumes:
- keycloak-volume:/srv/:ro
keycloak-realm-builder:
image: magentaaps/os2mo-keycloak-realm-builder:6
environment:
KEYCLOAK_VERSION: 14.0.0
POSTGRES_CONNECTION_STRING: postgres://keycloak:keycloak@keycloak-db/keycloak?sslmode=disable
KEYCLOAK_ADMIN_USERNAME: "admin"
KEYCLOAK_ADMIN_PASSWORD: "admin"
KEYCLOAK_URL: "http://keycloak:8080"
KEYCLOAK_SSL_REQUIRED_MO: external
KEYCLOAK_SSL_REQUIRED_LORA: external
KEYCLOAK_LORA_REALM_ENABLED: "true"
KEYCLOAK_LORA_CLIENT_SECRET: 158a2075-aa8a-421c-94a4-2df35377014a
KEYCLOAK_MO_CLIENT_REDIRECT_URI: '["http://localhost:5050/*", "http://localhost:5000/*", "http://localhost:5001/*", "http://localhost:5173/*", "http://localhost:4173/*"]'
KEYCLOAK_MO_CLIENT_WEB_ORIGIN: '["http://localhost:5050", "http://localhost:5000", "http://localhost:5001", "http://localhost:5173", "http://localhost:4173"]'
KEYCLOAK_RBAC_ENABLED: "true"
KEYCLOAK_REALM_USERS: '[
{
"enabled": true,
"uuid": "0fb62199-cb9e-4083-ba45-2a63bfd142d7",
"email": "[email protected]",
"username": "alvida",
"password": "alvida",
"firstname": "Alvida",
"lastname": "Nibe",
"roles": ["admin", "service_api"]
},
{
"enabled": true,
"uuid": "99e7b256-7dfa-4ee8-95c6-e3abe82e236a",
"email": "[email protected]",
"username": "bruce",
"password": "bruce",
"firstname": "Bruce",
"lastname": "Lee",
"roles": ["reader", "service_api"]
},
{
"enabled": true,
"uuid": "1c571f8f-0e3e-4ffa-9ff0-d35505781924",
"email": "[email protected]",
"username": "eline",
"password": "eline",
"firstname": "Eline",
"lastname": "Wedsgaard Christensen",
"roles": ["owner", "reader", "service_api"]
},
{
"enabled": true,
"uuid": "53181ed2-f1de-4c4a-a8fd-ab358c2c454a",
"email": "[email protected]",
"username": "anders",
"password": "anders",
"firstname": "Anders",
"lastname": "And",
"roles": ["owner", "reader", "service_api"]
}
]'
restart: on-failure
volumes:
- keycloak-volume:/srv/
keycloak-dipex-builder:
image: magentaaps/os2mo-keycloak-integration-builder:5
environment:
POSTGRES_CONNECTION_STRING: postgres://keycloak:keycloak@keycloak-db/keycloak?sslmode=disable
POSTGRES_SCHEMA_NAME: terraform_remote_state_dipex_client
TF_VAR_url: "http://keycloak:8080"
TF_VAR_admin_password: admin
TF_VAR_client_name: dipex
TF_VAR_client_secret: "603f1c82-d012-4d04-9382-dbe659c533fb"
TF_VAR_client_uuid: "d1fec000-baad-c0de-0000-004449504558"
TF_VAR_client_roles: '["admin", "service_api"]'
depends_on:
keycloak-realm-builder:
condition: service_completed_successfully
keycloak-db:
image: postgres:13
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: keycloak
restart: unless-stopped
amqp-metrics:
image: magentaaps/os2mo-amqp-trigger-metrics:latest
#build:
# context: ../os2mo-amqp-trigger-metrics
# dockerfile: Dockerfile
environment:
AMQP_URL: amqp://guest:guest@msg-broker:5672/
ports:
- "127.0.0.1:8012:8000"
restart: unless-stopped
profiles:
- amqp-metrics
volumes:
keycloak-volume: