From 82c7457ed1051e5cf82de5d642095944f06cef55 Mon Sep 17 00:00:00 2001 From: sam Date: Fri, 6 Feb 2026 11:13:14 +0000 Subject: [PATCH] new --- .gitea/workflows/deploy.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index f0bb86c..ac4f81b 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -12,11 +12,24 @@ jobs: run: | docker build -t my-local-app:latest . - - name: Remove Old Container + # - name: Remove Old Container + # run: | + # # Use '|| true' to force a success exit code even if the container is missing + # docker stop my-running-app || true + # docker rm my-running-app || true + - name: Remove Old Container and Free Port run: | - # Use '|| true' to force a success exit code even if the container is missing + # 1. Stop and remove by NAME (what we had before) docker stop my-running-app || true docker rm my-running-app || true + + # 2. EMERGENCY: Stop any container actually using port 9002 + # This finds the ID of any container bound to 9002 and kills it + PORT_OWNER=$(docker ps -q --filter "publish=9002") + if [ ! -z "$PORT_OWNER" ]; then + docker stop $PORT_OWNER + docker rm $PORT_OWNER + fi - name: Start New Container run: |