From fcc476e432ed9f9a18ad549725d782294a254f81 Mon Sep 17 00:00:00 2001 From: "soroush.asadi" Date: Mon, 1 Jun 2026 08:43:23 +0330 Subject: [PATCH] Fix critical port conflict: move portfolio off Gitea's port 3000 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Host port 3000 is Gitea (git.soroushasadi.com proxies to :3000). The portfolio was publishing 3000:3000 AND the deploy had a "Free Port 3000" step that force-removed every container on :3000 — which evicted the Gitea container. - compose: publish 3020:3000 instead of 3000:3000 - deploy: delete the "Free Port 3000" step entirely; compose recreates only our own named container and must never touch other stacks Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/deploy.yml | 19 ++++++------------- docker-compose.yml | 4 +++- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index ab6af6b..b2cda46 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -40,20 +40,13 @@ jobs: - name: Build Container run: docker compose build - - name: Free Port 3000 - run: | - # Remove any container publishing :3000 (old Next.js container, - # 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 - run: docker compose up -d --remove-orphans + # Compose recreates ONLY our own container (container_name: + # soroushasadi-site, project: soroushasadi). It must never touch + # other stacks. Do NOT add any step that removes containers by + # published port — port 3000 is Gitea and 5xxx/3xxx belong to + # other apps on this host. + run: docker compose up -d - name: Wait For Health Check run: | diff --git a/docker-compose.yml b/docker-compose.yml index 95bde57..9472b83 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,8 +11,10 @@ services: image: soroushasadi-site:latest container_name: soroushasadi-site restart: unless-stopped + # Host port 3020 → container 3000. Port 3000 on the host is Gitea + # (git.soroushasadi.com proxies to :3000) — NEVER publish on 3000. ports: - - "3000:3000" + - "3020:3000" environment: ASPNETCORE_ENVIRONMENT: Production DataDir: /data