This commit is contained in:
dabeeo
2026-04-20 17:15:27 +09:00
parent f75ec77ccf
commit de2a2e2c35
3 changed files with 31 additions and 51 deletions

View File

@@ -126,9 +126,14 @@ section "nginx 설정 문법 검사"
# ──────────────────────────────────────────
if command -v docker &>/dev/null && docker info &>/dev/null 2>&1; then
echo " docker run으로 nginx -t 실행 중..."
if docker run --rm \
-v "$NGINX_DIR/nginx.conf:/etc/nginx/nginx.conf:ro" \
-v "$NGINX_DIR/ssl:/etc/nginx/ssl:ro" \
# kamco-cds 네트워크가 있으면 연결 (upstream DNS 조회 가능)
NETWORK_OPT=""
if docker network ls --format '{{.Name}}' | grep -q "^kamco-cds$"; then
NETWORK_OPT="--network kamco-cds"
fi
if docker run --rm $NETWORK_OPT \
-v "$NGINX_DIR/nginx.conf:/etc/nginx/nginx.conf:ro,Z" \
-v "$NGINX_DIR/ssl:/etc/nginx/ssl:ro,Z" \
nginx:alpine nginx -t 2>&1; then
ok "nginx 설정 문법 OK"
else