Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Perform Health Checks with Hapi FHIR in Docker Swarm #646

Open
brett-onions opened this issue Feb 21, 2024 · 3 comments
Open

Unable to Perform Health Checks with Hapi FHIR in Docker Swarm #646

brett-onions opened this issue Feb 21, 2024 · 3 comments

Comments

@brett-onions
Copy link

Issue Description:
We are currently using Hapi Fhir (specifically the Hapi Fhir Starter) within Docker Swarm to manage our services. Our objective is to conduct health checks to monitor the current state of the service. Hapi FHIR provides a designated endpoint for health checks at /actuator/health, which we intend to utilize for this purpose.

However, we encountered a challenge while attempting to implement this. Our preference was to utilize the official image hapiproject/hapi. Regrettably, we encountered difficulty performing curl or wget commands to access the health check endpoint due to the absence of these applications within the image.

//docker-compose.yaml

healthcheck:
      test: /bin/curl --no-verbose --tries=1 --spider http:https://localhost:8080/actuator/health
      interval: 30s
      timeout: 5s
      retries: 5
      start_period: 2m

I seeking guidance on how to effectively conduct the health check without resorting to the creation of a separate image solely for the installation of curl or wget.

@jkiddo
Copy link
Collaborator

jkiddo commented Apr 16, 2024

@brett-onions which version of HAPI FHIR starter are you using?

@brett-onions
Copy link
Author

@jkiddo I am using Hapi FHIR v7.0.3

@jkiddo
Copy link
Collaborator

jkiddo commented Apr 22, 2024

@brett-onions I think you got the hostname wrong. If you wan't to use e.g. curl in a separate container that queries the HAPI FHIR container then you need to use the service name as hostname. If I start up a regular HAPI FHIR starter using e.g. docker run -p 8080:8080 hapiproject/hapi:latest then I can invoke curl http:https://localhost:8080/actuator/health with success. If I where to do it in e.g. a docker compose/swarm setting then the curl command would be e.g. curl http:https://<service-name>:8080/actuator/health

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants