From a2fea36c79367ce967e4b96a028aa5ff86c869dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Sun, 21 Oct 2018 20:49:01 +0300 Subject: [PATCH] Increase HEALTHCHECK start time for services that need to wait for host resolving during startup. In Docker Swarm mode the services listed below can get stuck in their start script, while they are waiting for other services become available. Now, with HEALTHCHECK enabled, docker does not resolve names of services that not pass HEALTHCHECK yet. Meaning that if one of the depenend services is not yet available, it will create a chain of failing services. The services below retry to resolve 100 time, with an average of 3.5 seconds. Hence, the --start-time flag is now set at 350 seconds. - dovecot (imap) - postfix (smtp) - rspamd (antispam) --- core/dovecot/Dockerfile | 2 +- core/postfix/Dockerfile | 2 +- services/rspamd/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/dovecot/Dockerfile b/core/dovecot/Dockerfile index c0d3e3cd..e19631ee 100644 --- a/core/dovecot/Dockerfile +++ b/core/dovecot/Dockerfile @@ -14,4 +14,4 @@ VOLUME ["/data", "/mail"] CMD /start.py -HEALTHCHECK CMD echo QUIT|nc localhost 110|grep "Dovecot ready." +HEALTHCHECK --start-period=350s CMD echo QUIT|nc localhost 110|grep "Dovecot ready." diff --git a/core/postfix/Dockerfile b/core/postfix/Dockerfile index 5533499e..e0529e01 100644 --- a/core/postfix/Dockerfile +++ b/core/postfix/Dockerfile @@ -13,4 +13,4 @@ VOLUME ["/data"] CMD /start.py -HEALTHCHECK CMD echo QUIT|nc localhost 25|grep "220 .* ESMTP Postfix" +HEALTHCHECK --start-period=350s CMD echo QUIT|nc localhost 25|grep "220 .* ESMTP Postfix" diff --git a/services/rspamd/Dockerfile b/services/rspamd/Dockerfile index d87a64f5..4337fb2e 100644 --- a/services/rspamd/Dockerfile +++ b/services/rspamd/Dockerfile @@ -18,4 +18,4 @@ VOLUME ["/var/lib/rspamd"] CMD /start.py -HEALTHCHECK CMD curl -f -L http://localhost:11334/ || exit 1 +HEALTHCHECK --start-period=350s CMD curl -f -L http://localhost:11334/ || exit 1