-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (68 loc) · 1.93 KB
/
Copy pathdocker-compose.yml
File metadata and controls
75 lines (68 loc) · 1.93 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
services:
postgres:
image: postgres:17.2
container_name: gym-postgres
environment:
POSTGRES_DB: gymdb
PGDATABASE: gymdb # client tools default to gymdb on connecting
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
PG_INIT_SCRIPT: /docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./init-scripts:/docker-entrypoint-initdb.d
networks:
- gym_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U admin"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
keycloak:
image: keycloak/keycloak:26.2.1 # Pin to a stable version
container_name: gym-keycloak
networks:
- gym_network
environment:
KC_HEALTH_ENABLED: "true"
KC_METRICS_ENABLED: "true"
KC_HTTP_ENABLED: "true"
KC_HOSTNAME_STRICT_HTTPS: "false"
KEYCLOAK_SSL_REQUIRED: "none"
KC_HOSTNAME_STRICT_BACKCHANNEL: "false"
KC_HOSTNAME: localhost
KC_HOSTNAME_PORT: "8080"
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://gym-postgres/gymdb
KC_DB_USERNAME: admin
KC_DB_PASSWORD: admin
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: admin
KC_DB_INITIALIZE: true # Force table creation
KC_DB_SCHEMA: gym_keycloak # Default PostgreSQL schema
JGROUPS_DISABLE_JDBC_PING: true # Disable problematic cluster ping
ports:
- "8100:8080"
- "9000:9000"
command: ["start-dev", "--debug"]
# - start-dev
# - start
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8080/health/ready || exit 1"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- keycloak_data:/opt/keycloak/data # Persist Keycloak data
volumes:
pgdata:
keycloak_data:
networks:
gym_network:
driver: bridge