Compare commits

..

2 Commits

Author SHA1 Message Date
soroush.asadi e79d2d6108 Ignore stale Next.js build output (.next/, node_modules/)
deploy / deploy (push) Failing after 44m43s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 08:30:06 +03:30
soroush.asadi 059c67bf76 Fix deploy: free port 3000 by removing any container publishing it
The previous name-based stop only removed soroushasadi-site, but the
container holding :3000 can have a different name (old Next.js build or
an orphan from a previously-named compose project), so the bind kept
failing. Now we remove every container publishing :3000 by filter, then
also remove by our known name as a fallback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 08:29:14 +03:30
2 changed files with 14 additions and 3 deletions
+10 -3
View File
@@ -40,10 +40,17 @@ jobs:
- name: Build Container - name: Build Container
run: docker compose build run: docker compose build
- name: Stop Existing Container - name: Free Port 3000
run: | run: |
docker stop soroushasadi-site 2>/dev/null || true # Remove any container publishing :3000 (old Next.js container,
docker rm soroushasadi-site 2>/dev/null || true # orphans from a previously-named compose project, etc.)
OLD=$(docker ps -a --filter publish=3000 -q)
if [ -n "$OLD" ]; then
echo "Removing containers on :3000 -> $OLD"
docker rm -f $OLD || true
fi
# Belt and suspenders: also remove by our known name.
docker rm -f soroushasadi-site 2>/dev/null || true
- name: Deploy - name: Deploy
run: docker compose up -d --remove-orphans run: docker compose up -d --remove-orphans
+4
View File
@@ -5,6 +5,10 @@ obj/
.vs/ .vs/
appsettings.*.local.json appsettings.*.local.json
# Stale Next.js build output (project migrated to .NET)
.next/
node_modules/
# CMS data (SQLite DB + uploads live in the Docker volume) # CMS data (SQLite DB + uploads live in the Docker volume)
/data /data