Standalone Java health check

- Updated Dockerfile to compile HealthCheck.java into the distroless image at /app
- Updated README with a "Docker Health Check" section documenting how to run the health check on-demand and how to enable periodic checks
- Also fixed Hibernate dialect override (SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT → HIBERNATE_DIALECT) to resolve DDL failures when starting with a fresh PostgreSQL database.
This commit is contained in:
c-schuler
2026-02-19 12:23:18 -07:00
parent 53837d6c94
commit 8f3335e8bb
5 changed files with 73 additions and 2 deletions

View File

@@ -8,9 +8,17 @@ services:
SPRING_DATASOURCE_USERNAME: "admin"
SPRING_DATASOURCE_PASSWORD: "admin"
SPRING_DATASOURCE_DRIVER_CLASS_NAME: "org.postgresql.Driver"
SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT: ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgresDialect
HIBERNATE_DIALECT: ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgresDialect
ports:
- "8080:8080"
# Uncomment to enable periodic health checks.
# Can also be run manually: docker exec hapi-fhir-jpaserver-start java -cp /app HealthCheck
# healthcheck:
# test: ["CMD", "java", "-cp", "/app", "HealthCheck"]
# interval: 30s
# timeout: 10s
# start_period: 60s
# retries: 3
depends_on:
hapi-fhir-postgres:
condition: service_healthy