fix(dev): persist Keycloak across restarts (dev-file + named volume) #42

Merged
sharang merged 1 commits from fix/m7.1-kc-dev-file into main 2026-06-04 14:46:16 +00:00
Showing only changes of commit ea70a2eb33 - Show all commits
+7 -1
View File
@@ -5,7 +5,11 @@ services:
environment:
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: admin
KC_DB: dev-mem
# dev-file persists Keycloak's H2 DB under /opt/keycloak/data/h2/
# so the realm + test users survive container restarts. With the
# previous dev-mem the realm dissolved every time KC went idle,
# breaking local M7.1 smoke testing.
KC_DB: dev-file
KC_HEALTH_ENABLED: "true"
ports:
- "8080:8080"
@@ -15,6 +19,7 @@ services:
volumes:
- ./keycloak/realm-export.json:/opt/keycloak/data/import/realm-export.json:ro
- ./keycloak/themes/certifai:/opt/keycloak/themes/certifai:ro
- keycloak-data:/opt/keycloak/data/h2
healthcheck:
test: ["CMD-SHELL", "exec 3<>/dev/tcp/localhost/8080 && echo -e 'GET /realms/master HTTP/1.1\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n' >&3 && head -1 <&3 | grep -q '200 OK'"]
interval: 10s
@@ -256,3 +261,4 @@ volumes:
langfuse-db-data:
langfuse-clickhouse-data:
langfuse-clickhouse-logs:
keycloak-data: