-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
66 lines (60 loc) · 2.05 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
services:
postgres:
image: postgres:15
environment:
- POSTGRES_USER=netzgrafikeditor
- POSTGRES_PASSWORD=netzgrafikeditor
- POSTGRES_DB=netzgrafikeditor
ports:
- "5432:5432"
keycloak:
image: quay.io/keycloak/keycloak:23.0
# as we need to access keycloak from backend Docker container under docker internal port, we need to start Keycloak on 8081, port forwarding in Docker run is not enough
command: start-dev --import-realm --http-port 8081 --hostname localhost
ports:
- 8081:8081
volumes:
# TODO can we avoid copying the realm config? Download in an init container from the repo....?
- ./keycloak/netzgrafikeditor-realm.json:/opt/keycloak/data/import/netzgrafikeditor-realm.json
environment:
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=netzgrafikeditor
keycloak-healthcheck:
image: busybox
depends_on:
keycloak:
condition: service_started
command: sh -c "until wget -q -O- http://keycloak:8081/realms/netzgrafikeditor/.well-known/openid-configuration >/dev/null 2>&1; do sleep 1; done"
healthcheck:
test: [ "CMD-SHELL", "exit 0" ]
interval: 1s
timeout: 1s
retries: 5
backend:
build: backend
entrypoint: /bin/bash
command: >
-c "nginx && /cnb/process/web"
ports:
- 8080:8080
depends_on:
keycloak-healthcheck:
condition: service_completed_successfully
volumes:
- ./backend/application.yml:/workspace/BOOT-INF/classes/application.yml
- ./backend/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./backend/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
healthcheck:
test: [ "CMD", "bash", "-c", "curl -v --fail http://127.0.0.1:8080/actuator/health" ]
interval: 5s
timeout: 10s
retries: 15
frontend:
image: ghcr.io/schweizerischebundesbahnen/netzgrafik-editor-frontend:2.9.11
# set platform as necessary:
platform: linux/x86_64
ports:
- 4200:4200
depends_on:
backend:
condition: service_healthy