From 9e24000992f1b5d9a347059a0e072e7b7829e56a Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Auad Date: Mon, 4 May 2026 18:17:31 +0000 Subject: [PATCH] Agregados healthchecks a hapi-fhir y hapi-db con cadena de dependencias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hapi-fhir ahora espera a que hapi-db esté healthy antes de arrancar, y nginx espera a que hapi-fhir esté healthy. El healthcheck de hapi-fhir consulta /fhir/metadata con start_period de 60s para tolerar el tiempo de inicialización de Spring Boot. Co-Authored-By: Claude Sonnet 4.6 --- docker-compose.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 18adbfe..dc97a80 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,8 @@ services: container_name: hapi-fhir image: "hapiproject/hapi:latest" depends_on: - - hapi-db + hapi-db: + condition: service_healthy volumes: - ./hapi-config:/data/hapi environment: @@ -14,6 +15,12 @@ services: SPRING_DATASOURCE_PASSWORD: ${SPRING_DATASOURCE_PASSWORD} SPRING_DATASOURCE_DRIVERCLASSNAME: ${SPRING_DATASOURCE_DRIVERCLASSNAME} SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT: ${SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT} + healthcheck: + test: ["CMD-SHELL", "curl -sf http://localhost:8080/fhir/metadata > /dev/null"] + interval: 30s + timeout: 10s + retries: 5 + start_period: 60s networks: - hapi-network hapi-db: @@ -63,8 +70,10 @@ services: container_name: nginx image: nginx:alpine depends_on: - - hapi-fhir - - bus-gateway + hapi-fhir: + condition: service_healthy + bus-gateway: + condition: service_started environment: TZ: ${TZ:-America/Argentina/Buenos_Aires} ports: