From f3ccacb2da6da8b502bcb472bfb0bc6a7c776068 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Fri, 12 Dec 2025 15:36:01 +0100 Subject: [PATCH] Stop coolify container last during upgrade MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reorder container stop sequence to stop dependencies first (db, redis, realtime) before stopping the main coolify container. This prevents the upgrade process from being interrupted when triggered from Coolify UI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- other/nightly/upgrade.sh | 3 ++- scripts/upgrade.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/other/nightly/upgrade.sh b/other/nightly/upgrade.sh index aa0c82865..ba21c82ff 100644 --- a/other/nightly/upgrade.sh +++ b/other/nightly/upgrade.sh @@ -77,8 +77,9 @@ echo "All images pulled successfully." >>"$LOGFILE" # Stop and remove existing Coolify containers to prevent conflicts # This handles both old installations (project "source") and new ones (project "coolify") +# Stop coolify last to allow upgrade process to complete gracefully echo "Stopping existing Coolify containers..." >>"$LOGFILE" -for container in coolify coolify-db coolify-redis coolify-realtime; do +for container in coolify-db coolify-redis coolify-realtime coolify; do if docker ps -a --format '{{.Names}}' | grep -q "^${container}$"; then docker stop "$container" >>"$LOGFILE" 2>&1 || true docker rm "$container" >>"$LOGFILE" 2>&1 || true diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index f922983c6..204240bb6 100644 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -175,7 +175,8 @@ echo " All images pulled successfully." log_section "Step 4/6: Stopping existing containers" echo "" echo "4/6 Stopping existing containers..." -for container in coolify coolify-db coolify-redis coolify-realtime; do +# Stop coolify last to allow upgrade process to complete gracefully +for container in coolify-db coolify-redis coolify-realtime coolify; do if docker ps -a --format '{{.Names}}' | grep -q "^${container}$"; then echo " - Stopping ${container}..." log "Stopping container: ${container}"