fix(dev): persist Keycloak across restarts (dev-file + named volume) #42
Reference in New Issue
Block a user
Delete Branch "fix/m7.1-kc-dev-file"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Stops Keycloak from dissolving every time the certifai stack goes idle.
KC_DB: dev-mem→KC_DB: dev-file— H2 now writes to/opt/keycloak/data/h2/.keycloak-datanamed volume mounted at that path so the DB survives container restarts.realm-export.jsonbind-mount stays read-only —--import-realmcontinues to run on fresh starts, sodocker compose down -vremains the clean-slate lever.Bit twice during the M7.1 testing session: every time KC went idle the realm + the 5 test users vanished and we had to re-import. This closes that gap.
Test plan
docker compose config— yaml parsesdocker compose down -v && docker compose up -d keycloak→ KC up → admin/admin login at:8080shows the certifai realm with all 5 test usersdocker compose restart keycloak→ realm + users still there afterwards (the actual regression we're fixing)