Handle NAS system service using port 80
- Detect if system service (DSM/Web Station) uses port 80 - Automatically switch nginx to port 8080 if port 80 is occupied - Avoid touching system services, only manage Docker containers - Prevents conflicts with Synology NAS built-in services 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9b8712237c
commit
cf666af1ee
10
.github/workflows/deploy.yml
vendored
10
.github/workflows/deploy.yml
vendored
@ -89,12 +89,18 @@ jobs:
|
||||
|
||||
echo "Deployed to $DEPLOY; backup saved at $BACKUP"
|
||||
|
||||
# 5) 포트 80 사용 중인 컨테이너 정리
|
||||
# 5) 포트 80 사용 중인 서비스 확인 및 처리
|
||||
echo "Checking port 80 usage..."
|
||||
netstat -tlnp | grep :80 || true
|
||||
docker ps --format "table {{.Names}}\t{{.Ports}}" | grep ":80" || true
|
||||
|
||||
# 포트 80 사용하는 모든 컨테이너 정지
|
||||
# NAS 시스템 서비스가 80포트 사용 중이면 nginx를 8080으로 실행
|
||||
if netstat -tln | grep -q ":80.*LISTEN"; then
|
||||
echo "Port 80 is used by system service, switching nginx to port 8080"
|
||||
sed -i 's/80:80/8080:80/g' "$DEPLOY/docker-compose.yml"
|
||||
fi
|
||||
|
||||
# Docker 컨테이너만 정리 (시스템 서비스는 건드리지 않음)
|
||||
docker ps --filter "publish=80" -q | xargs -r docker stop
|
||||
docker ps -a --filter "publish=80" -q | xargs -r docker rm
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user