fix(ci): recreate dev container to avoid name conflict on deploy #740

Merged
jmiller merged 1 commits from fix/deploy-dev-container-conflict into dev 2026-07-05 15:19:01 +00:00
Owner

Follow-up to #737. With the tag-expansion bug fixed, the dev deploy now builds and pushes the image successfully but fails at the final step:

Container mokogitea-dev  Error response from daemon: Conflict.
The container name "/mokogitea-dev" is already in use by container "3bdd86a5..."

The dev service uses a fixed container_name: mokogitea-dev, and the symlinked /opt/gitea-dev path makes compose's derived project name unstable (Using name "gitea-dev" from a symlink) — so the existing container isn't recognized as belonging to the project and docker compose up tries to create rather than recreate, hitting the name conflict.

Fix: remove any lingering fixed-name container first (docker rm -f mokogitea-dev), pin the compose project name (-p gitea-dev), and force a fresh recreate (--force-recreate) so the new image comes up and migrations run.

Once merged, the push to dev re-triggers deploy-dev.yml; combined with #739 this should produce the first fully-green dev deploy (image builds → container recreated → migrations 362–366 apply → health check passes).

YAML validated, no trailing whitespace.

https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT

Follow-up to #737. With the tag-expansion bug fixed, the dev deploy now builds and pushes the image successfully but fails at the final step: ``` Container mokogitea-dev Error response from daemon: Conflict. The container name "/mokogitea-dev" is already in use by container "3bdd86a5..." ``` The dev service uses a fixed `container_name: mokogitea-dev`, and the symlinked `/opt/gitea-dev` path makes compose's derived project name unstable (`Using name "gitea-dev"` from a symlink) — so the existing container isn't recognized as belonging to the project and `docker compose up` tries to **create** rather than **recreate**, hitting the name conflict. **Fix:** remove any lingering fixed-name container first (`docker rm -f mokogitea-dev`), pin the compose project name (`-p gitea-dev`), and force a fresh recreate (`--force-recreate`) so the new image comes up and migrations run. Once merged, the push to `dev` re-triggers `deploy-dev.yml`; combined with #739 this should produce the first fully-green dev deploy (image builds → container recreated → migrations 362–366 apply → health check passes). YAML validated, no trailing whitespace. https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT
jmiller added 1 commit 2026-07-05 15:18:33 +00:00
fix(ci): recreate dev container to avoid name conflict on deploy
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 1m0s
Universal: PR Check / Branch Policy (pull_request) Successful in 1s
PR RC Release / Build RC Release (pull_request) Successful in 2s
Universal: PR Check / Validate PR (pull_request) Successful in 9s
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 2s
Generic: Project CI / Lint & Validate (pull_request) Successful in 34s
Universal: PR Check / Secret Scan (pull_request) Successful in 1m11s
Generic: Project CI / Tests (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
6b81922c47
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
jmiller merged commit 8c63b00953 into dev 2026-07-05 15:19:01 +00:00
jmiller deleted branch fix/deploy-dev-container-conflict 2026-07-05 15:19:01 +00:00
Sign in to join this conversation.