Skip to content

Commit

Permalink
Add docker healthcheck
Browse files Browse the repository at this point in the history
Signed-off-by: John Gomersall <thegoms@gmail.com>
  • Loading branch information
john-gom committed Jun 28, 2024
1 parent 51e75f4 commit 75d87e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ RUN --mount=type=cache,target=/root/.m2 set -x && \
# TODO: Use a builder image for faster startup. e.g. https://www.keycloak.org/server/containers
FROM quay.io/keycloak/keycloak:${KEYCLOAK_VERSION} as keycloak_builder

# Enable health and metrics support
ENV KC_HEALTH_ENABLED=true
ENV KC_METRICS_ENABLED=true

# Don't configure a database vendor here as for tests we want to use the dev-file option
# ENV KC_DB=postgres

Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ services:
- KEYCLOAK_BASE_URL
- KEYCLOAK_REALM_NAME
- KC_SPI_EVENTS_LISTENER_REDIS_EVENT_LISTENER_REDIS_URL=redis://${REDIS_URL}/0
healthcheck:
test: timeout 10s bash -c ':> /dev/tcp/localhost/8080'
start_interval: 10s

0 comments on commit 75d87e4

Please sign in to comment.