Configurable Keycloak Docker image and bash setup scripts.
This project provides a docker image which extends the production-oriented keycloak and adds features for development and testing. The Jefferson Lab image sets up a Docker healthcheck and Docker entrypoint, installs client tools (see lib.sh), and adds some default configuration for the Jefferson Lab environment. The entrypoint integrates with the healthcheck such that the container is "healthy" only when keycloak is both running and configured. Configuration is supported via environment variables and a conventional directory named /container-entrypoint-initdb.d
of bash scripts that can be overwritten by mounting a volume.
- 1.x version based on Keycloak 20.x
- 2.x version based on Keycloak 26.x
- Grab project
git clone https://github.com/JeffersonLab/keycloak
cd keycloak
- Launch Compose
docker compose up
- Navigate to admin console
http://localhost:8081/auth
Note: Login with username admin
and password admin
Mount a volume at /container-entrypoint-initdb.d
containing bash scripts to run, ordered by name ascending. See example.
Environment variables:
Name | Description |
---|---|
KC_FRONTEND_URL | Front end scheme, hostname, port, and relative path |
KC_BACKEND_URL | Back end scheme, hostname, port, and relative path |
KC_HTTP_RELATIVE_PATH | Relative path, probably must match KC_FRONTEND_URL and KC_BACKEND_URL |
KC_BOOTSTRAP_ADMIN_USERNAME | Admin username |
KC_BOOTSTRAP_ADMIN_PASSWORD | Admin password |
- Bump the version number in the VERSION file and commit and push to GitHub (using Semantic Versioning).
- The CD GitHub Action should run automatically invoking:
- The Create release GitHub Action to tag the source and create release notes summarizing any pull requests. Edit the release notes to add any missing details.
- The Publish docker image GitHub Action to create a new demo Docker image.