-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
81 lines (76 loc) · 1.83 KB
/
Copy pathdocker-compose.yml
File metadata and controls
81 lines (76 loc) · 1.83 KB
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
version: '3.8'
services:
postgres:
image: postgres:15
container_name: keycloak_postgres
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: keycloak_password
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U keycloak"]
interval: 10s
timeout: 5s
retries: 5
networks:
- keycloak-network
keycloak:
image: quay.io/keycloak/keycloak:26.0.7
container_name: keycloak
environment:
KC_DB: postgres
KC_DB_URL_HOST: postgres
KC_DB_URL_PORT: 5432
KC_DB_URL_DATABASE: keycloak
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: keycloak_password
KC_HEALTH_ENABLED: "true"
KC_HTTP_ENABLED: "true"
KC_HOSTNAME_STRICT: "false"
KC_HOSTNAME_STRICT_HTTPS: "false"
KC_LEGACY_OBSERVABILITY_INTERFACE: "true"
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
command: start-dev
healthcheck:
test: [ "CMD", "/opt/keycloak/bin/kc.sh", "show-config" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
networks:
- keycloak-network
init-keycloak:
image: alpine:latest
depends_on:
keycloak:
condition: service_healthy
networks:
- keycloak-network
volumes:
- type: bind
source: ./keycloak-init.sh
target: /init.sh
- type: bind
source: ./.env
target: /.env
command: >
sh -c "
apk update &&
apk add --no-cache curl jq &&
dos2unix /init.sh 2>/dev/null || true &&
chmod +x /init.sh &&
sh /init.sh
"
networks:
keycloak-network:
driver: bridge
volumes:
postgres_data: