[GH-ISSUE #635] Healtcheck with custom listen-http #473

Closed
opened 2026-05-07 00:24:33 +02:00 by BreizhHardware · 6 comments

Originally created by @Andersbiha on GitHub (Feb 23, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/635

I'm running Ntfy in a docker-compose setup with Traefik in front.

Upon upgrading from 1.31.0 to 2.0.1 I'm no longer able to access Ntfy through Traefik.

I've traced the issue down to the container health checks added in #555.
The health check doesn't take the listen-http setting into account, causing issues for those of us who's not running Ntfy on localhost:80.

This issue is easily fixed by either disabling the health check or overriding the default health check URL (See https://docs.docker.com/compose/compose-file/compose-file-v2/#healthcheck).

Originally created by @Andersbiha on GitHub (Feb 23, 2023). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/635 I'm running Ntfy in a docker-compose setup with Traefik in front. Upon upgrading from `1.31.0` to `2.0.1` I'm no longer able to access Ntfy through Traefik. I've traced the issue down to the container health checks added in #555. The health check doesn't take the `listen-http` setting into account, causing issues for those of us who's not running Ntfy on `localhost:80`. This issue is easily fixed by either disabling the health check or overriding the default health check URL (See https://docs.docker.com/compose/compose-file/compose-file-v2/#healthcheck).
Author
Owner

@binwiederhier commented on GitHub (Feb 23, 2023):

Do you suggest I remove the HEALTHCHECK in the Dockerfile entirely? Or let people override it like you did? Maybe this can be added to the docs somewhere?

I am leaning towards removal entirely, honestly. The healthcheck doesn't add much.

<!-- gh-comment-id:1442070931 --> @binwiederhier commented on GitHub (Feb 23, 2023): Do you suggest I remove the HEALTHCHECK in the Dockerfile entirely? Or let people override it like you did? Maybe this can be added to the docs somewhere? I am leaning towards removal entirely, honestly. The healthcheck doesn't add much.
Author
Owner

@Andersbiha commented on GitHub (Feb 24, 2023):

I would remove it and add a section to https://docs.ntfy.sh/install/#docker describing how to configure it.

I suspect leaving it in the Dockerfile is gonna be a source of confusion and it will most likely affect more people than removing it again.

<!-- gh-comment-id:1443472560 --> @Andersbiha commented on GitHub (Feb 24, 2023): I would remove it and add a section to https://docs.ntfy.sh/install/#docker describing how to configure it. I suspect leaving it in the Dockerfile is gonna be a source of confusion and it will most likely affect more people than removing it again.
Author
Owner

@djraw commented on GitHub (Feb 26, 2023):

I am leaning towards removal entirely, honestly. The healthcheck doesn't add much.

Deleting the healthcheck entirely gets my +1

I have a supposedly "unhealthy" ntfy because I don't run it on port 80 outside the container.
As I use watchtower to automatically update, the healthcheck disable or override using composer gets reset on the updates. So I would prefer to remove the healthcheck.
We will notice a not running ntfy container soon enough anyway when scripts fail to send notifications. ;)

<!-- gh-comment-id:1445336954 --> @djraw commented on GitHub (Feb 26, 2023): > I am leaning towards removal entirely, honestly. The healthcheck doesn't add much. Deleting the healthcheck entirely gets my +1 I have a supposedly "unhealthy" ntfy because I don't run it on port 80 outside the container. As I use watchtower to automatically update, the healthcheck disable or override using composer gets reset on the updates. So I would prefer to remove the healthcheck. We will notice a not running ntfy container soon enough anyway when scripts fail to send notifications. ;)
Author
Owner

@Andersbiha commented on GitHub (Feb 27, 2023):

I quickly whipped together a fix here .

Let me know if you want me to make a PR 👍

<!-- gh-comment-id:1446416656 --> @Andersbiha commented on GitHub (Feb 27, 2023): I quickly whipped together a fix [here](https://github.com/binwiederhier/ntfy/compare/main...Andersbiha:ntfy:fix-635) . Let me know if you want me to make a PR :+1:
Author
Owner

@binwiederhier commented on GitHub (Feb 27, 2023):

@Andersbiha That looks great. I'll happily accept that PR.

Sorry for the inconvenience, folks!

<!-- gh-comment-id:1446425891 --> @binwiederhier commented on GitHub (Feb 27, 2023): @Andersbiha That looks great. I'll happily accept that PR. Sorry for the inconvenience, folks!
Author
Owner

@Andersbiha commented on GitHub (Feb 27, 2023):

@binwiederhier Thank you for a great project and the quick merge. 👍

<!-- gh-comment-id:1446577056 --> @Andersbiha commented on GitHub (Feb 27, 2023): @binwiederhier Thank you for a great project and the quick merge. :+1:
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#473
No description provided.