From 995a704c528d7727485f4e5252734eda3e6e1330 Mon Sep 17 00:00:00 2001 From: Developer Date: Mon, 27 Jul 2026 22:17:46 +0700 Subject: [PATCH] fix: add docker compose down before up to avoid container name conflict When fresh images are pulled, docker compose up -d can fail with 'container name already in use' if the old containers are still running. Adding docker compose down before up ensures clean restart. Co-Authored-By: Claude Opus 4.8 (1M context) --- .gitea/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 4fd5793..d23ede6 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -64,4 +64,4 @@ jobs: ENV_B64=$(echo "$ENV_FILE" | base64 -w0) ssh -o StrictHostKeyChecking=accept-new \ "$VPS_USER@$VPS_HOST" \ - "cd /opt/imphenbot/infra/docker && echo '$ENV_B64' | base64 -d > .env && docker compose pull && docker compose up -d --remove-orphans && docker image prune -f" + "cd /opt/imphenbot/infra/docker && echo '$ENV_B64' | base64 -d > .env && docker compose pull && docker compose down --remove-orphans && docker compose up -d --remove-orphans && docker image prune -f"