Class ComposeFileGenerator
Profile: bootstrap
Starts a stock postgres:17 and a base HAPI FHIR server
(hapiproject/hapi:v8.8.0-1) with the generated application.yaml
mounted. HAPI loads all configured IG packages into postgres. Once healthy
(detected by HTTP polling in FhirBootstrapTask),
the HAPI container is committed as a named image and the postgres database is
captured via pg_dump to packages.sql in the output directory.
Profile: test
Starts a fresh postgres:17 with packages.sql mounted at
/docker-entrypoint-initdb.d/01-packages.sql so the database is restored
automatically on first start. Starts HAPI from the pre-committed snapshot image
(${FHIR_FROG_IMAGE}). Fast startup (~60s) because all packages are
already present in the restored postgres database.
Health checks
HAPI services use healthcheck: disable: true because the hapiproject/hapi
image is distroless and has no shell or curl. HAPI readiness is checked externally
by polling /actuator/health via HTTP (see FhirBootstrapTask and the
<waitfor> in build.xml).
-
Field Details
-
HAPI_BASE_IMAGE
- See Also:
-
BOOTSTRAP_CONTAINER_NAME
- See Also:
-
POSTGRES_BOOTSTRAP_CONTAINER_NAME
- See Also:
-
-
Constructor Details
-
ComposeFileGenerator
public ComposeFileGenerator()
-
-
Method Details
-
generate
Writesdocker-compose.ymltooutputDir/docker-compose.yml.hapi-bootstrapmountsconfigRelPath(e.g../application.yaml) which may containpackageUrl: file://...entries for local #dev/#current packages.hapi-testmounts the-testvariant (e.g../application-test.yaml) which has those entries stripped — HAPI v8 fetches packageUrl before checkingreloadExisting, so it would crash if the packages volume is absent.postgres-testmounts./packages.sqlat/docker-entrypoint-initdb.d/01-packages.sqlso the database is restored from the bootstrappg_dumpon first container start.- Parameters:
outputDir- directory to write the file into (created if absent)imageTag- Docker image tag for the committed HAPI snapshotconfigRelPath- relative path from the Compose file toapplication.yaml- Throws:
IOException
-