From 61c65b1a93c971a69ef30fd52d8e787f48ebf540 Mon Sep 17 00:00:00 2001 From: Holden Karau Date: Mon, 28 Nov 2022 16:23:48 -0800 Subject: [PATCH 1/3] Add a healthcheck. --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 79cba4f8..785a6133 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,9 @@ ARG NGINX_NAME="nginx-${NGINX_VERSION}" FROM debian AS build +HEALTHCHECK --interval=30s --timeout=3s --start-period=60s \ + CMD (curl -f http://localhost/) || exit 1 + ARG NGINX_VERSION # https://hg.nginx.org/nginx ARG NGINX_BRANCH=default From 2efd33d7be206b361b139bc142fa06352eabcde6 Mon Sep 17 00:00:00 2001 From: Holden Karau Date: Sun, 4 Dec 2022 09:12:45 -0800 Subject: [PATCH 2/3] Update Dockerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Michael Vorburger ⛑️ Signed-off-by: Holden Karau --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 785a6133..7fe35429 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ARG NGINX_NAME="nginx-${NGINX_VERSION}" FROM debian AS build HEALTHCHECK --interval=30s --timeout=3s --start-period=60s \ - CMD (curl -f http://localhost/) || exit 1 + CMD (curl -f http://localhost/ipfs/QmXjYBY478Cno4jzdCcPy4NcJYFrwHZ51xaCP8vUwN9MGm/) || exit 1 ARG NGINX_VERSION # https://hg.nginx.org/nginx From d5eef656257067fd63d6959c10dfd121b1168a27 Mon Sep 17 00:00:00 2001 From: Holden Karau Date: Sun, 4 Dec 2022 09:15:51 -0800 Subject: [PATCH 3/3] Move healthcheck to the nginx container not the build container --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7fe35429..adc21c46 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,6 @@ ARG NGINX_NAME="nginx-${NGINX_VERSION}" FROM debian AS build -HEALTHCHECK --interval=30s --timeout=3s --start-period=60s \ - CMD (curl -f http://localhost/ipfs/QmXjYBY478Cno4jzdCcPy4NcJYFrwHZ51xaCP8vUwN9MGm/) || exit 1 - ARG NGINX_VERSION # https://hg.nginx.org/nginx ARG NGINX_BRANCH=default @@ -88,6 +85,9 @@ RUN echo "Cloning nginx and building $NGINX_VERSION (rev $NGINX_COMMIT from '$NG FROM nginx:${NGINX_VERSION} +HEALTHCHECK --interval=30s --timeout=3s --start-period=60s \ + CMD (curl -f http://localhost/ipfs/QmXjYBY478Cno4jzdCcPy4NcJYFrwHZ51xaCP8vUwN9MGm/) || exit 1 + ARG NGINX_NAME COPY --from=build /usr/sbin/nginx /usr/sbin/