fix(ci): stop & remove old container before deploying new one
docker compose up --force-recreate only works when Compose owns the container. If the container was started outside Compose (e.g. manually via docker restart), Compose can't recreate it and errors with "container name already in use". Explicitly stopping and removing it first handles both cases cleanly. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -91,7 +91,10 @@ jobs:
|
|||||||
DOCKER_BUILDKIT: 1
|
DOCKER_BUILDKIT: 1
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: docker compose up -d --no-deps --force-recreate api
|
run: |
|
||||||
|
docker stop drsousan_api 2>/dev/null || true
|
||||||
|
docker rm drsousan_api 2>/dev/null || true
|
||||||
|
docker compose up -d --no-deps api
|
||||||
|
|
||||||
- name: Wait for healthy
|
- name: Wait for healthy
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user