Files
FishServer/scripts/run_fishserver.sh
2026-04-08 19:32:23 +08:00

21 lines
736 B
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.
#!/usr/bin/env bash
# 在「单一 Python 环境」下启动网关FishMeasure / FishAction 子进程默认使用同一解释器。
#
# conda activate fishserver
# export PUBLIC_BASE_URL=http://<本机对外IP>:8001 # 可选,填 video URL 前缀
# PORT=8001 bash scripts/run_fishserver.sh
#
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT/fish_api"
export PUBLIC_BASE_URL="${PUBLIC_BASE_URL:-http://127.0.0.1:8000}"
# 单一环境:勿设置 PYTHON_FISH_MEASURE / PYTHON_FISH_ACTION使用当前 uvicorn 的 Python
unset PYTHON_FISH_MEASURE PYTHON_FISH_ACTION 2>/dev/null || true
PORT="${PORT:-8000}"
HOST="${HOST:-0.0.0.0}"
exec uvicorn app.main:app --host "$HOST" --port "$PORT"