From 6b81922c47f45a20bea8aef11eb4365f1fd43602 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sun, 5 Jul 2026 10:17:08 -0500 Subject: [PATCH] fix(ci): recreate dev container to avoid name conflict on deploy After the tag fix (#737) the dev deploy builds and pushes the image fine but fails at `docker compose up -d` with: Conflict. The container name "/mokogitea-dev" is already in use The dev service uses a fixed container_name, and the symlinked /opt/gitea-dev path makes compose's derived project name unstable, so an existing container is not recognized as the project's and `up` tries to create rather than recreate. Remove any lingering fixed-name container first, pin the compose project name, and force a fresh recreate so migrations run against the new image. Claude-Session: https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT --- .mokogitea/workflows/custom/deploy-dev.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.mokogitea/workflows/custom/deploy-dev.yml b/.mokogitea/workflows/custom/deploy-dev.yml index 106c882eb0..609227ee44 100644 --- a/.mokogitea/workflows/custom/deploy-dev.yml +++ b/.mokogitea/workflows/custom/deploy-dev.yml @@ -97,7 +97,14 @@ jobs: echo 'Restarting dev container...' cd /opt/gitea-dev sed -i "s|${{ env.IMAGE }}:[^ ]*|${{ env.IMAGE }}:$TAG|" docker-compose.yml - docker compose up -d mokogitea-dev + # The dev service uses a fixed container_name (mokogitea-dev). If a + # container with that name lingers under a different/none compose + # project (the symlinked /opt/gitea-dev path makes the derived project + # name unstable), `compose up` fails with a name conflict instead of + # recreating. Remove any such container first so the name is free, pin + # the project name for determinism, then force a fresh recreate. + docker rm -f mokogitea-dev 2>/dev/null || true + docker compose -p gitea-dev up -d --force-recreate mokogitea-dev echo 'Health check...' for i in 1 2 3 4 5 6 7 8; do