17 lines
574 B
Python
17 lines
574 B
Python
"""
|
|
蝶雅采购智能体平台 - 启动脚本
|
|
用法:
|
|
python3 run.py # 开发模式 (Flask dev server)
|
|
python3 run.py --prod # 生产模式 (Gunicorn)
|
|
"""
|
|
import sys, os
|
|
|
|
if '--prod' in sys.argv:
|
|
# 生产模式 - Gunicorn
|
|
os.system("gunicorn -w 4 -b 0.0.0.0:18888 --timeout 120 --max-requests 800 --max-requests-jitter 100 --access-logfile logs/access.log --error-logfile logs/error.log app:app")
|
|
else:
|
|
# 开发模式
|
|
from app import app
|
|
from config import APP_HOST, APP_PORT
|
|
app.run(host=APP_HOST, port=APP_PORT, debug=True)
|