@echo off REM 生产环境启动脚本 - app.py (Flask + SocketIO) REM 使用 Gunicorn + geventwebsocket 支持高并发 REM 注意: Windows 下使用 waitress 替代 Gunicorn echo ============================================ echo 启动 VF React 生产服务器 (Windows) echo ============================================ cd /d "%~dp0" REM 检查 waitress(Windows 兼容的 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