From b3c975314d2bcbc9ef75800094504e0f58635555 Mon Sep 17 00:00:00 2001 From: bt90 Date: Fri, 23 Dec 2022 18:26:21 +0100 Subject: [PATCH 1/2] docker: add basic healthcheck --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 6916cabc..9d9ae9b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,5 +3,7 @@ MAINTAINER Philipp C. Heckel COPY ntfy /usr/bin +HEALTHCHECK --interval=60s --timeout=10s CMD wget --no-verbose --tries=1 --spider http://localhost/config.js || exit 1 + EXPOSE 80/tcp ENTRYPOINT ["ntfy"] From dab18e5b40b03f76bb36d200377782c23b4be0c8 Mon Sep 17 00:00:00 2001 From: bt90 Date: Tue, 27 Dec 2022 16:40:15 +0100 Subject: [PATCH 2/2] Use health endpoint --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9d9ae9b7..52ccff6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ MAINTAINER Philipp C. Heckel COPY ntfy /usr/bin -HEALTHCHECK --interval=60s --timeout=10s CMD wget --no-verbose --tries=1 --spider http://localhost/config.js || exit 1 +HEALTHCHECK --interval=60s --timeout=10s CMD wget -q --tries=1 http://localhost/v1/health -O - | grep -Eo '"healthy"\s*:\s*true' || exit 1 EXPOSE 80/tcp ENTRYPOINT ["ntfy"]