统一 Docker Compose 部署,并将客户端拆分为独立子项目。
移除宿主机/conda 启动脚本与 dev 联调工具,后端仅通过 docker compose 部署并默认启用 GPU。模拟客户端与语音确认页迁入 clients/ 下自包含目录,切断对后端源码路径的依赖。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
36
clients/demo-client/start.sh
Executable file
36
clients/demo-client/start.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user