From dc6aefd0abd7d450526066ae4060f8883cb4ff9b Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Mon, 6 Apr 2026 18:52:40 +0800 Subject: [PATCH] fix: prevent duplicate network creation in deploy-dev Use docker network inspect to check if network exists before creating. --- .gitea/workflows/deploy-dev.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/deploy-dev.yml b/.gitea/workflows/deploy-dev.yml index 932664b..4e916d6 100644 --- a/.gitea/workflows/deploy-dev.yml +++ b/.gitea/workflows/deploy-dev.yml @@ -66,11 +66,13 @@ jobs: # Clean up any legacy manual containers docker rm -f nas-dashboard-dev 2>/dev/null || true - # Ensure network exists - docker network create nas-dashboard_internal 2>/dev/null || true + # Ensure network exists (create only if it doesn't exist) + if ! docker network inspect nas-dashboard_internal >/dev/null 2>&1; then + docker network create nas-dashboard_internal + fi # Use a dedicated project name to avoid killing production (which is project 'nas-dashboard') - # and deploy using theSynced compose file. + # and deploy using the synced compose file. docker compose -f docker-compose.dev.yml -p nas-dashboard-dev down --remove-orphans || true docker compose -f docker-compose.dev.yml -p nas-dashboard-dev up -d --build --pull never