From dc079c58ad1476384f80de3e451ee1c1edcfc6d1 Mon Sep 17 00:00:00 2001 From: j4n Date: Wed, 25 Feb 2026 09:54:17 +0100 Subject: [PATCH] docker/ci: correct acme path and catch unhealthy status --- .github/workflows/docker-ci.yaml | 13 ++++++++----- docker/chatmail_relay.dockerfile | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-ci.yaml b/.github/workflows/docker-ci.yaml index 1de06043..0a8b4437 100644 --- a/.github/workflows/docker-ci.yaml +++ b/.github/workflows/docker-ci.yaml @@ -186,8 +186,8 @@ jobs: rsync -e "ssh -o StrictHostKeyChecking=accept-new" -avz root@ns.testrun.org:/tmp/${ACME_DIR} acme-restore || true rsync -avz root@ns.testrun.org:/tmp/${DKIM_DIR} dkimkeys-restore || true # restore to acme & dkim state - rsync -avz acme-restore/${ACME_DIR}/ root@${HOST}:/var/lib/acme/ || true - rsync -avz dkimkeys-restore/${DKIM_DIR}/ root@${HOST}:/etc/dkimkeys/ || true + rsync -avz acme-restore/${ACME_DIR}/acme/ root@${HOST}:/var/lib/acme/ || true + rsync -avz dkimkeys-restore/${DKIM_DIR}/dkimkeys/ root@${HOST}:/etc/dkimkeys/ || true # copy acme & dkim state to docker bind mounts ssh root@${HOST} 'mkdir -p /srv/chatmail/certs /srv/chatmail/dkim && cp -a /var/lib/acme/. /srv/chatmail/certs/ && cp -a /etc/dkimkeys/. /srv/chatmail/dkim/' @@ -228,8 +228,7 @@ jobs: env: HOST: ${{ matrix.host }} run: | - # Stream journald inside the container so we see chatmail-init output in real time - # (docker logs doesn't work with logging driver: none) + # Stream journald inside the container ssh root@${HOST} 'docker exec chatmail journalctl -f --no-pager' & LOG_PID=$! trap "kill $LOG_PID 2>/dev/null || true" EXIT @@ -240,9 +239,13 @@ jobs: echo "Container is healthy." exit 0 fi + if [ "$status" = "unhealthy" ]; then + echo "Container is unhealthy!" + break + fi sleep 5 done - echo "Container did not become healthy in time." + echo "Container did not become healthy." kill $LOG_PID 2>/dev/null || true echo "--- failed units ---" ssh root@${HOST} 'docker exec chatmail systemctl --failed --no-pager' || true diff --git a/docker/chatmail_relay.dockerfile b/docker/chatmail_relay.dockerfile index 4f0d3e9b..8f39060b 100644 --- a/docker/chatmail_relay.dockerfile +++ b/docker/chatmail_relay.dockerfile @@ -90,7 +90,7 @@ COPY --chmod=555 ./docker/chatmail-init.sh /chatmail-init.sh COPY --chmod=555 ./docker/entrypoint.sh /entrypoint.sh COPY --chmod=555 ./docker/healthcheck.sh /healthcheck.sh -HEALTHCHECK --interval=15s --timeout=10s --retries=3 \ +HEALTHCHECK --interval=10s --start-period=180s --timeout=10s --retries=3 \ CMD /healthcheck.sh STOPSIGNAL SIGRTMIN+3