Files
ai_wht_wechat/backend/start_prod.sh
2026-01-06 19:36:42 +08:00

33 lines
782 B
Bash
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
# 小红书Python服务启动脚本生产环境
cd "$(dirname "$0")"
echo "========================================"
echo " 小红书登录服务(生产模式)"
echo "========================================"
echo ""
# 激活虚拟环境
echo "[环境] 激活虚拟环境: $(pwd)/venv"
source venv/bin/activate
if [ $? -ne 0 ]; then
echo "[错误] 虚拟环境激活失败"
exit 1
fi
# 显示Python版本和路径
echo "[Python] $(python --version)"
echo "[路径] $(which python)"
echo ""
echo "[启动] 正在启动Python服务生产环境端口8000..."
echo "[说明] 按Ctrl+C停止服务"
echo ""
# 设置环境为生产环境
export ENV=prod
# 启动服务(生产模式)
python -m uvicorn main:app --host 0.0.0.0 --port 8000