-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose-services.yaml
73 lines (70 loc) · 2.1 KB
/
docker-compose-services.yaml
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
services:
postgres14:
image: postgres:14-alpine
restart: always
container_name: postgres14
volumes:
- postgres14-data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=risnorms
- POSTGRES_PASSWORD=test
- POSTGRES_USER=test
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U test -d risnorms"]
interval: 5s
retries: 3
start_period: 5s
timeout: 3s
redis:
image: cgr.dev/chainguard/redis:latest
#extra_hosts:
# - localhost:host-gateway
container_name: redis
command:
- "--maxmemory 256mb"
- "--maxmemory-policy allkeys-lru"
- "--timeout 300"
- "--tcp-keepalive 10"
- "--user redis on +@all -CONFIG ~* >password"
- "--user default off resetchannels -@all"
ports:
- "6379:6379"
healthcheck:
test:
[
"CMD-SHELL",
"redis-cli -h 127.0.0.1 --user redis -a password PING | grep 'PONG' || exit 1",
]
interval: 5s
retries: 5
start_period: 3s
timeout: 5s
keycloak:
image: quay.io/keycloak/keycloak:26.1.0
command: ["start-dev", "--import-realm"]
container_name: keycloak
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: test
KC_HEALTH_ENABLED: true
KC_METRICS_ENABLED: true
KC_HTTP_PORT: 8443
KC_HOSTNAME_URL: http://localhost:8443/keycloak
ports:
- "8443:8443"
volumes:
- ./local/keycloak/realm.json:/opt/keycloak/data/import/realm.json:ro
# health endpoint läuft unter 9000
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:9000/health/live',
]
interval: 5s
timeout: 5s
retries: 20
volumes:
postgres14-data: