Files
operating-room-monitor-server/clients/demo-client/start.sh
Kevin 6bc6801df9 统一 Docker Compose 部署,并将客户端拆分为独立子项目。
移除宿主机/conda 启动脚本与 dev 联调工具,后端仅通过 docker compose 部署并默认启用 GPU。模拟客户端与语音确认页迁入 clients/ 下自包含目录,切断对后端源码路径的依赖。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 15:56:53 +08:00

37 lines
891 B
Bash
Executable File

#!/usr/bin/env bash
# Start the standalone demo client page for LAN access.
# Backend must be running first: docker compose up -d --build (in repo root)
# Usage: ./start.sh [port]
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT"
PORT="${1:-${DEMO_PORT:-38081}}"
HOST="${DEMO_HOST:-0.0.0.0}"
API_PORT="${API_PORT:-38080}"
LAN_IP="$(python3 - <<'PY'
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
s.connect(("8.8.8.8", 80))
print(s.getsockname()[0])
except OSError:
print("")
finally:
s.close()
PY
)"
echo "Demo client listening on ${HOST}:${PORT}"
echo "Local: http://127.0.0.1:${PORT}/"
if [[ -n "${LAN_IP}" && ( "${HOST}" == "0.0.0.0" || "${HOST}" == "::" ) ]]; then
echo "LAN: http://${LAN_IP}:${PORT}/"
echo "Base URL: http://${LAN_IP}:${API_PORT}"
fi
exec python3 server.py --host "$HOST" -p "$PORT"