From 9811b7023da74ecbc8eb6c5f3e8b6ed10da4e0c5 Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Mon, 18 May 2026 00:07:17 +0800 Subject: [PATCH] fix: stop old containers before compose up in production deploy - Add docker compose down step before up to ensure the production container is recreated with the freshly-built image - Without this, compose sees the old running container and skips it, while the Docker 24 network bug is silently swallowed by || true Co-Authored-By: Claude Opus 4.7 --- .gitea/workflows/deploy.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index a96d24a..d555447 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -244,6 +244,11 @@ jobs: set -e export DOCKER_API_VERSION=1.43 + # Stop and remove old containers to force recreate with new image. + # External networks (gitea_gitea, nas-dashboard_internal) are preserved. + docker compose -f /nas-dashboard/docker-compose.yml down 2>/dev/null || true + echo "Old containers stopped" + # Docker 24 compose fails when it can't connect external networks # during container creation. Try compose first; if the container # isn't created, strip networks from compose file and retry.