From 6489c231fc47d819909b62e995abfa0e79eb86bc Mon Sep 17 00:00:00 2001 From: Pratik <68642400+pratikbalar@users.noreply.github.com> Date: Wed, 9 Feb 2022 15:58:51 +0530 Subject: [PATCH] Dockerfile: add HEALTHCHECK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add `wge`t based healthchecks. Don't want to add `curl` just for healthchecks and increase size of image by ~2.5 MB(Every penny counts) when you can achieve similar with alpine's built-in `wget` and `awk`. --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 3cdf577..8469612 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,8 @@ ENV BIND_ADDRESS=:4050 \ DATABASE_URL=/data/go-neb.db?_busy_timeout=5000 \ UID=1337 \ GID=1337 + +HEALTHCHECK --interval=5s --timeout=3s CMD wget -qS -O /dev/null localhost${BIND_ADDRESS}/test | awk -F':' '$1 ~ / Status$/ { print $2 ~ /200 OK/ }' COPY --from=builder /tmp/go-neb/go-neb /usr/local/bin/go-neb # Copy libolm.so