Files
sentinel-home-ai/scripts/start_core.sh

30 lines
771 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.
#!/bin/bash
# FAM-Core 启动脚本 (NAS 端)
# 用法: ./scripts/start_core.sh
set -e
APP_DIR="$(cd "$(dirname "$0")/.." && pwd)/fam-core"
CONFIG_FILE="$APP_DIR/config/config.yaml"
if [ ! -f "$CONFIG_FILE" ]; then
echo "错误: 配置文件不存在: $CONFIG_FILE"
echo "请复制 config.yaml.example 为 config.yaml 并修改实际值"
exit 1
fi
cd "$APP_DIR"
# 加载项目级环境变量ORACLE_SYNC_TOKEN 等,与甲骨文端保持一致)
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
if [ -f "$SCRIPT_DIR/../.env" ]; then
source "$SCRIPT_DIR/../.env"
fi
# 检查虚拟环境
if [ -d "venv" ]; then
source venv/bin/activate
fi
echo "启动 FAM-Core (端口 8000)..."
exec gunicorn -w 1 -b 0.0.0.0:8000 --timeout 120 src.fam_core.app:app