Fix deploy: stop old container before starting new one
deploy / deploy (push) Failing after 2s

Port 3000 was already allocated by the previous container from the
Next.js era. --remove-orphans only removes containers within the same
compose project, so the old one survived. Explicitly stop+rm the named
container before docker compose up so the port is always free.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-01 08:17:11 +03:30
parent f2d6300d72
commit e5094b53ff
+5
View File
@@ -40,6 +40,11 @@ jobs:
- name: Build Container - name: Build Container
run: docker compose build run: docker compose build
- name: Stop Existing Container
run: |
docker stop soroushasadi-site 2>/dev/null || true
docker rm soroushasadi-site 2>/dev/null || true
- name: Deploy - name: Deploy
run: docker compose up -d --remove-orphans run: docker compose up -d --remove-orphans