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

[F/R] add healthcheck to dockerfile #46

Open
pvnovarese opened this issue May 14, 2020 · 3 comments
Open

[F/R] add healthcheck to dockerfile #46

pvnovarese opened this issue May 14, 2020 · 3 comments

Comments

@pvnovarese
Copy link

Have you considered adding a simple healthcheck to the Dockerfile?

I think to do this you will need to change the base image from scratch to alpine, which will increase the resulting final image (on my system it more than tripled it), and I have an appreciation for keeping this as simple and minimal as possible. Also I am not super familiar with the ins and outs of exporters so I'm not really sure how much value a healthcheck will even add in this case.

The other possibility would be to add a built-in check function to the pihole-exporter itself, which might keep the bloat down a bit.

pvn@gyarados /home/pvn> docker image ls | grep pihole-exporter
pvnovarese/pihole-exporter         latest              16e60d69390e        15 minutes ago      8.07MB
ekofr/pihole-exporter              latest              35e4393afb6f        2 weeks ago         2.45MB

Anyway, all I did is change

ARG IMAGE=alpine

and then add

HEALTHCHECK CMD wget --spider http://127.0.0.1:9617/metrics || exit 1

I can submit a PR if you're interested in doing this.

@eko
Copy link
Owner

eko commented Jan 1, 2021

Hi @pvnovarese,

First, sorry about the delay.

I will be happy to have a health check if you want to submit a PR. Elsewhere I could take a look at it in the next days.

Thank you

@SuperSandro2000
Copy link

Adding such a healthcheck will only increase start time to one minute. This is because the first check fails and the next one is only one minute after. This is relevant for reverse proxies like traefik which remove routes when the container is not healthy.

@vremenar
Copy link
Contributor

Healthcheck added to docker-compose.yml so you can implement it that way.

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

4 participants