new
All checks were successful
Docker Deploy / build-and-deploy (push) Successful in 17s

This commit is contained in:
sam
2026-02-06 11:13:14 +00:00
parent f5adb1000c
commit 82c7457ed1

View File

@@ -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: |