thread-master/status-dev.sh

45 lines
1.1 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
echo "=== 巡樓開發環境服務狀態 ==="
echo ""
# Infra (Mongo/Redis)
echo "📦 Infra (Docker):"
docker compose -f infra/docker-compose.yml ps 2>/dev/null || echo " 未運行或 docker compose 不可用"
echo ""
# Port 佔用檢查
check_port() {
local port=$1
local name=$2
if lsof -ti:$port >/dev/null 2>&1; then
local pid=$(lsof -ti:$port | head -1)
local cmd=$(ps -p $pid -o comm= 2>/dev/null || echo "unknown")
echo "$name (port $port) - PID: $pid ($cmd)"
else
echo "$name (port $port) - 未運行"
fi
}
echo "🔌 服務 Port 狀態:"
check_port 8890 "Gateway (API)"
check_port 8891 "Worker (Go)"
check_port 5173 "Frontend (Vite)"
# Node worker 沒有固定 port檢查進程
echo ""
echo "🔧 Node Worker (style-8d):"
if pgrep -f "style-8d" >/dev/null 2>&1; then
pgrep -f "style-8d" | while read pid; do
echo " ✅ 運行中 - PID: $pid"
done
else
echo " ❌ 未運行"
fi
echo ""
echo "📋 管理指令:"
echo " 啟動所有服務: ./start-dev.sh"
echo " 停止所有服務: ./stop-dev.sh"
echo " 啟動 infra: make dev-infra"
echo " 停止 infra: make dev-infra-down"