Skip to content

Commit

Permalink
improved healthcheck with proper command sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
henrythasler authored and bokysan committed Jan 6, 2024
1 parent 1c71da7 commit 9b2d54f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]

0 comments on commit 9b2d54f

Please sign in to comment.