diff --git a/roles/apps/templates/compose-files/postfix.yml.j2 b/roles/apps/templates/compose-files/postfix.yml.j2 index 7cb8740..6f98697 100644 --- a/roles/apps/templates/compose-files/postfix.yml.j2 +++ b/roles/apps/templates/compose-files/postfix.yml.j2 @@ -17,6 +17,12 @@ services: - postfix volumes: - "./data:/etc/opendkim/keys:rw" + healthcheck: + test: ["CMD-SHELL", "printf \"EHLO healthcheck\\nquit\\n\" | { while read l ; do sleep 1; echo $$l; done } | nc -w 2 127.0.0.1 587 | grep -qE \"^220.*ESMTP Postfix\""] + interval: 30s + timeout: 5s + retries: 3 + start_period: 10s networks: {{ apps_postfix_docker_network }}: