1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-01-09 17:55:57 +00:00

docker: Use supervisord to launch chasquid and dovecot

Today, we launch dovecot in the background and chasquid in the
foreground using sudo.

This means that dovecot failures won't propagate, and signals to the
container (e.g. to stop it) also don't get propagated to dovecot
(because it's in the background) or chasquid (because they don't go
beyond the sudo process).

Thanks to [Guiorgy@github](https://github.com/Guiorgy) for identifying
the problem, proposing alternatives, help debugging, and discussing this
in https://github.com/albertito/chasquid/pull/70.
This commit is contained in:
Alberto Bertogli
2025-08-04 11:11:50 +01:00
parent d0afe102de
commit cf18565b80
3 changed files with 70 additions and 7 deletions

View File

@@ -27,7 +27,8 @@ RUN DEBIAN_FRONTEND=noninteractive \
chasquid \
dovecot-lmtpd dovecot-imapd dovecot-pop3d \
dovecot-sieve dovecot-managesieved \
acl libcap2-bin sudo certbot && \
supervisor \
acl libcap2-bin certbot && \
apt-get autoremove --purge -y -q && \
apt-get autoclean -y -q && \
rm -rf /var/lib/apt/lists/*
@@ -42,6 +43,7 @@ RUN setcap CAP_NET_BIND_SERVICE=+eip /usr/bin/chasquid
# Copy docker-specific configurations.
COPY docker/dovecot.conf /etc/dovecot/dovecot.conf
COPY docker/chasquid.conf /etc/chasquid/chasquid.conf
COPY docker/supervisord.conf /etc/supervisor/supervisord.conf
# Copy utility scripts.
COPY docker/add-user.sh docker/entrypoint.sh /