Files
vf_react/start_production.bat
2025-12-11 21:11:43 +08:00

31 lines
865 B
Batchfile
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.

@echo off
REM 生产环境启动脚本 - app.py (Flask + SocketIO)
REM 使用 Gunicorn + geventwebsocket 支持高并发
REM 注意: Windows 下使用 waitress 替代 Gunicorn
echo ============================================
echo 启动 VF React 生产服务器 (Windows)
echo ============================================
cd /d "%~dp0"
REM 检查 waitressWindows 兼容的 WSGI 服务器)
python -c "import waitress" 2>nul
if errorlevel 1 (
echo 正在安装 waitress...
pip install waitress
)
echo.
echo 启动服务器...
echo 端口: 5001
echo 线程数: 8
echo.
REM Windows 下使用 waitress 替代 gunicorn
REM 注意waitress 不支持 WebSocket建议在 Linux 服务器上部署生产环境
python -c "from waitress import serve; from app import app; print('Starting...'); serve(app, host='0.0.0.0', port=5001, threads=8)"
pause