Deploy: kill anything holding port 8420 before bringing the new container up
"docker compose down" before "pull/up" (previous commit) didn't fix the port conflict -- it only tears down containers this compose project itself tracks, so a stale/orphaned container from an earlier deploy (or anything else bound to 8420, especially with restart: unless-stopped fighting back) slips through untouched and the new "up" fails with "port is already allocated". This is root-cause-agnostic instead: find and stop/remove *any* container publishing 8420, compose-managed or not, right before pull/up. --remove-orphans on the down step too, for services that used to be in the compose file and aren't anymore.
This commit is contained in:
@@ -69,4 +69,9 @@ jobs:
|
||||
ssh-keyscan -p "$DEPLOY_PORT" "$DEPLOY_HOST" >> ~/.ssh/known_hosts 2>/dev/null
|
||||
ssh -i ~/.ssh/deploy_key -p "$DEPLOY_PORT" -o StrictHostKeyChecking=yes \
|
||||
espressoframe_deployer@"$DEPLOY_HOST" \
|
||||
'cd ~/espresso-frame && docker compose down && docker compose pull && docker compose up -d'
|
||||
'cd ~/espresso-frame && \
|
||||
docker compose down --remove-orphans && \
|
||||
docker ps -q --filter publish=8420 | xargs -r docker stop && \
|
||||
docker ps -aq --filter publish=8420 | xargs -r docker rm && \
|
||||
docker compose pull && \
|
||||
docker compose up -d'
|
||||
|
||||
Reference in New Issue
Block a user