From f536787fb61641fb11e659c4a089065ad26f47ca Mon Sep 17 00:00:00 2001 From: Alex Palaistras Date: Sun, 29 Oct 2023 16:22:26 +0000 Subject: [PATCH] dovecot: Enable and start on health-check pass --- service/dovecot/Containerfile | 2 +- .../dovecot/container/config/conf.d/99-health-check.conf | 6 ++++++ service/dovecot/quadlet/dovecot.container | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 service/dovecot/container/config/conf.d/99-health-check.conf diff --git a/service/dovecot/Containerfile b/service/dovecot/Containerfile index 22929dd..b2d3fbb 100644 --- a/service/dovecot/Containerfile +++ b/service/dovecot/Containerfile @@ -4,7 +4,7 @@ ARG VERSION=2.3.19 RUN apt-get update -y && apt-get install -y --no-install-recommends \ dovecot-imapd=1:${VERSION}* dovecot-lmtpd=1:${VERSION}* dovecot-mysql=1:${VERSION}* \ dovecot-sieve=1:${VERSION}* dovecot-managesieved=1:${VERSION}* dovecot-fts-xapian \ - gettext ca-certificates curl + gettext ca-certificates curl netcat-traditional RUN rm -Rf /etc/dovecot COPY container/config /etc/dovecot diff --git a/service/dovecot/container/config/conf.d/99-health-check.conf b/service/dovecot/container/config/conf.d/99-health-check.conf new file mode 100644 index 0000000..5b63959 --- /dev/null +++ b/service/dovecot/container/config/conf.d/99-health-check.conf @@ -0,0 +1,6 @@ +service health-check { + executable = script -p health-check.sh + inet_listener health-check { + port = 5001 + } +} diff --git a/service/dovecot/quadlet/dovecot.container b/service/dovecot/quadlet/dovecot.container index 854129d3..35f8e2c 100644 --- a/service/dovecot/quadlet/dovecot.container +++ b/service/dovecot/quadlet/dovecot.container @@ -9,8 +9,10 @@ AddCapability=SYS_CHROOT ContainerName=%N EnvironmentFile=%E/coreos-home-server/%N/%N.env EnvironmentFile=%E/coreos-home-server/rspamd/rspamd.env +HealthCmd=sh -c 'echo PING | nc -q 1 localhost 5001 | grep -q PONG' Image=localhost/%N:latest Network=internal +PodmanArgs=--sdnotify=healthy PublishPort=143:143 PublishPort=993:993 PublishPort=4190:4190