From 9b2d54f15e7e15d7d79394146c6db3e54a1a7a47 Mon Sep 17 00:00:00 2001 From: Henry Thasler Date: Sat, 6 Jan 2024 11:34:00 +0100 Subject: [PATCH] improved healthcheck with proper command sequence --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bb1b329..bf92c5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,7 +61,7 @@ VOLUME [ "/var/spool/postfix", "/etc/postfix", "/etc/opendkim/keys" ] USER root WORKDIR /tmp -HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD printf "EHLO healthcheck\n" | nc 127.0.0.1 587 | grep -qE "^220.*ESMTP Postfix" +HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD printf "EHLO healthcheck\nquit\n" | { while read l ; do sleep 1; echo $l; done } | nc 127.0.0.1 587 -w 2 | grep -qE "^220.*ESMTP Postfix" EXPOSE 587 CMD [ "/bin/sh", "-c", "/scripts/run.sh" ]