Fix port 80 already in use error

- Add port 80 usage detection with netstat and docker ps
- Stop and remove containers using port 80 before deployment
- Ensures clean port 80 for nginx service
- Prevents 'bind: address already in use' errors

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
happybell80 2025-07-08 00:50:53 +09:00
parent 3e3f0ae0ef
commit 9b8712237c

View File

@ -89,7 +89,16 @@ jobs:
echo "Deployed to $DEPLOY; backup saved at $BACKUP"
# 5) docker-compose 재시작
# 5) 포트 80 사용 중인 컨테이너 정리
echo "Checking port 80 usage..."
netstat -tlnp | grep :80 || true
docker ps --format "table {{.Names}}\t{{.Ports}}" | grep ":80" || true
# 포트 80 사용하는 모든 컨테이너 정지
docker ps --filter "publish=80" -q | xargs -r docker stop
docker ps -a --filter "publish=80" -q | xargs -r docker rm
# 6) docker-compose 재시작
cd "$DEPLOY"
docker-compose down 2>/dev/null || true
docker-compose up -d --build