fix(ci): explicitly stop old app containers before redeploy
CI/CD / CI · API (dotnet build + test) (push) Successful in 39s
CI/CD / CI · Admin API (dotnet build) (push) Successful in 31s
CI/CD / CI · Dashboard (tsc) (push) Successful in 1m3s
CI/CD / CI · Admin Web (tsc) (push) Successful in 34s
CI/CD / CI · Website (tsc) (push) Successful in 43s
CI/CD / CI · Koja (tsc) (push) Successful in 48s
CI/CD / Deploy · all services (push) Failing after 7s

Existing containers lack compose project labels so Compose cannot claim
them — it tries to CREATE alongside them and hits a name conflict.

Fix: stop + rm only the 6 meezi app containers by name before compose up.
Postgres, redis, and all other projects are never touched.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-01 08:08:19 +03:30
parent 5ba09c2ef1
commit 9f002433c7
+13 -10
View File
@@ -310,16 +310,20 @@ jobs:
DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1 COMPOSE_DOCKER_CLI_BUILD: 1
- name: Deploy main app services - name: Stop old app containers
# Only cycle the app containers — postgres and redis are long-running # The existing containers were created before compose labels were added,
# infrastructure that must never be restarted by CI. # so Compose can't claim them and hits a name conflict on 'up'.
# --force-recreate: always swap in the freshly-built images. # This step removes only meezi's own 6 app containers — never touches
# --no-deps: do NOT pull in postgres/redis as dependencies. # postgres, redis, or any other project's containers.
run: | run: |
docker compose up -d \ for name in meezi-api meezi-web meezi-website meezi-koja meezi-admin-api meezi-admin-web; do
--no-deps \ docker stop "$name" 2>/dev/null || true
--force-recreate \ docker rm "$name" 2>/dev/null || true
api web website koja done
- name: Deploy main app services
run: |
docker compose up -d --no-deps api web website koja
- name: Deploy admin services - name: Deploy admin services
run: | run: |
@@ -328,7 +332,6 @@ jobs:
-f docker-compose.admin.yml \ -f docker-compose.admin.yml \
up -d \ up -d \
--no-deps \ --no-deps \
--force-recreate \
admin-api admin-web admin-api admin-web
- name: Wait for main API healthy - name: Wait for main API healthy