docker: use buildx, stop services before portcheck

This commit is contained in:
j4n
2026-02-23 12:07:10 +01:00
parent 97b309b12c
commit 07040897d6
2 changed files with 11 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
# syntax=docker/dockerfile:1
FROM jrei/systemd-debian:12 AS base
ENV LANG=en_US.UTF-8

View File

@@ -49,6 +49,16 @@ if [ -z "${CMDEPLOY_STAGES:-}" ] \
&& [ "$(cat "$FINGERPRINT_FILE")" = "$current_fp" ]; then
echo "[INFO] No changes detected ($current_fp), skipping deploy."
else
# Stop chatmail services so the port check sees a clean state.
# (ss -p inside Docker can't always identify processes, causing false
# "port occupied" failures.) The activate stage will restart them.
echo "[INFO] Stopping services for clean port check..."
systemctl stop postfix dovecot nginx opendkim unbound \
filtermail doveauth chatmail-metadata iroh-relay mtail fcgiwrap 2>/dev/null || true
# Show listening ports before deploy (diagnostic for port-check failures)
echo "[DEBUG] Listening ports before deploy:"
ss -lptn | while IFS= read -r line; do echo " $line"; done
export CMDEPLOY_STAGES="${CMDEPLOY_STAGES:-configure,activate}"
$CMDEPLOY run --config "$CHATMAIL_INI" --ssh-host @local
echo "$current_fp" > "$FINGERPRINT_FILE"