From 66fc36068d5446d2a43e46544429fa398d71ea24 Mon Sep 17 00:00:00 2001 From: Francisco Daniel Castro Borrome Date: Sat, 16 May 2026 23:29:31 -0400 Subject: [PATCH] fix(deploy): force-remove all tucolmadord- containers before compose up Containers started outside of compose (manual docker run) lack the compose project label so docker compose down does not remove them, causing "container name already in use" on the next CD run. The name-filter cleanup catches both compose-managed and manually- started containers regardless of how they were created. Co-Authored-By: Claude Sonnet 4.6 --- deploy-production.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deploy-production.sh b/deploy-production.sh index 6972340..91b8cc6 100644 --- a/deploy-production.sh +++ b/deploy-production.sh @@ -123,6 +123,9 @@ echo "🧹 Aggressive cleanup of old Docker artifacts..." echo " Stopping and removing all tucolmadord containers..." docker ps -q --filter "label=com.docker.compose.project=tucolmadord" | xargs -r docker rm -f 2>/dev/null || true docker compose down --remove-orphans 2>/dev/null || true +# Also force-remove any containers with the tucolmadord- name prefix that may have +# been started outside of compose (manual runs) and therefore lack compose labels +docker ps -aq --filter "name=tucolmadord-" | xargs -r docker rm -f 2>/dev/null || true # 4b. Remove ALL tucolmadord Named volumes explicitly (with force if they're in use) echo " Removing Named volumes..."