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

Adding HEALTHCHECK for docker container #251

Closed
wants to merge 1 commit into from
Closed

Adding HEALTHCHECK for docker container #251

wants to merge 1 commit into from

Conversation

ViBiOh
Copy link

@ViBiOh ViBiOh commented Feb 25, 2019

No description provided.

@Dynom
Copy link
Collaborator

Dynom commented Feb 25, 2019

Hi @ViBiOh,

Thanks for your time and effort!

I need to ponder this change for a bit as I'm not intimately familiar with the HEALTHCHECK directive and it's implications on installations.

I'm interested to learn what this means for Imaginary. Imaginary exposes a health-point that can be externally consumed and the docker run command fails if it fails to start the binary. afaik there isn't an in-between state that needs monitoring and the start-time is very short (no need to wait for something long, like a db starting or something network related). It sounds like the HEALTHCHECK is mostly valuable for multi-process containers (which Imaginary hasn't).

I will brush up on it and will report back later.

@Dynom Dynom self-assigned this Feb 25, 2019
@Dynom
Copy link
Collaborator

Dynom commented Feb 25, 2019

Since it's a Dockerfile change, would you mind using release/next as a base for your PR? We're currently in the process of a fairly large overhaul of the Docker setup.

https://github.com/h2non/imaginary/tree/release/next

@jbergstroem
Copy link
Contributor

I'm generally not a fan of using curl for HEALTHCHECK. Also, worth mentioning that this is not in OCI yet.

@ViBiOh
Copy link
Author

ViBiOh commented Feb 25, 2019

Hi, I was trying to monitor the appropriate way to check if the service is up and running. If checking the PID 1 is the way, it's ok for me.

I'm using imaginary as a sidecar for a file browser. The port is not exposed and HTTP only accessible from inside the appropriate network.

@Dynom
Copy link
Collaborator

Dynom commented Feb 26, 2019

Hi, I was trying to monitor the appropriate way to check if the service is up and running. If checking the PID 1 is the way, it's ok for me.

I'm using imaginary as a sidecar for a file browser. The port is not exposed and HTTP only accessible from inside the appropriate network.

Understandable setup! Is it acceptable for your setup to roll your own Dockerfile using:

FROM h2non/imaginary:<tag>

RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y curl

HEALTHCHECK --retries=10 CMD curl --fail http://localhost:$PORT/health

This will provide you with the desired functionality, without forcing everybody to use it. Otherwise everybody else need to roll a similar Dockerfile and reset HEALTCHECK to a noop.

@ViBiOh
Copy link
Author

ViBiOh commented Feb 28, 2019

I've ended using following config in my docker-compose

    healthcheck:
      test: ["CMD", "ps", "-p", "1", "--no-headers"]
      retries: 10

@ViBiOh ViBiOh closed this Feb 28, 2019
@ViBiOh ViBiOh deleted the patch-1 branch February 28, 2019 07:44
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

Successfully merging this pull request may close these issues.

3 participants