-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
106 lines (98 loc) · 2.85 KB
/
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
name: quiz
volumes:
quiz_api_postgres_data:
services:
nginx-reverse-proxy:
container_name: quiz.nginx-reverse-proxy
image: quiz-nginx-reverse-proxy
ports:
- 80:80
extra_hosts:
- "host.docker.internal:host-gateway"
- "LOCALHOST_NAME:host-gateway"
keycloak:
container_name: quiz.auth
image: quay.io/keycloak/keycloak:24.0.0
command:
- start-dev
- --import-realm
ports:
- 8080:8080
volumes:
- ./keycloak/import/:/opt/keycloak/data/import/
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD}
KC_HTTP_PORT: 8080
KC_HOSTNAME_URL: http://LOCALHOST_NAME/auth
KC_HOSTNAME_ADMIN_URL: http://LOCALHOST_NAME/auth
KC_HOSTNAME_STRICT_BACKCHANNEL: true
#KC_HOSTNAME_DEBUG: true
KC_HTTP_RELATIVE_PATH: /auth/
KC_HTTP_ENABLED: true
KC_HEALTH_ENABLED: true
KC_METRICS_ENABLED: true
#KC_LOG_LEVEL: DEBUG
extra_hosts:
- "host.docker.internal:host-gateway"
- "LOCALHOST_NAME:host-gateway"
healthcheck:
test : ['CMD-SHELL', '[ -f /tmp/HealthCheck.java ] || echo "public class HealthCheck { public static void main(String[] args) throws java.lang.Throwable { System.exit(java.net.HttpURLConnection.HTTP_OK == ((java.net.HttpURLConnection)new java.net.URL (args[0]).openConnection()).getResponseCode() ? 0 : 1); } }" > /tmp/HealthCheck.java && java /tmp/HealthCheck.java http://LOCALHOST_NAME/auth/health']
interval: 3s
timeout: 15s
retries: 5
angular-ui:
container_name: quiz.ui
image: quiz-ui
ports:
- 4200:80
extra_hosts:
- "host.docker.internal:host-gateway"
- "LOCALHOST_NAME:host-gateway"
quiz-db:
container_name: quiz.api.postgres
image: postgres:latest
ports:
- 5432:5432
environment:
- POSTGRES_DB=quiz
- POSTGRES_PASSWORD=${POSTGRES_QUIZ_PASSWORD}
- POSTGRES_USER=quiz
volumes:
- quiz_api_postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "quiz", "-U", "quiz"]
interval: 3s
timeout: 60s
retries: 20
quiz-api:
container_name: quiz.api
image: quiz-api:0.0.1-SNAPSHOT
ports:
- 7084:7084
environment:
HOSTNAME: LOCALHOST_NAME
SERVER_ADDRESS: 0.0.0.0
depends_on:
keycloak:
condition: service_healthy
quiz-db:
condition: service_healthy
extra_hosts:
- "host.docker.internal:host-gateway"
- "LOCALHOST_NAME:host-gateway"
bff:
container_name: quiz.bff
image: quiz-bff:0.0.1-SNAPSHOT
ports:
- 7080:7080
environment:
HOSTNAME: LOCALHOST_NAME
SERVER_ADDRESS: 0.0.0.0
CLIENT_SECRET: secret
depends_on:
keycloak:
condition: service_healthy
extra_hosts:
- "host.docker.internal:host-gateway"
- "LOCALHOST_NAME:host-gateway"