2026-07-21 15:37:36 +08:00
|
|
|
"""
|
|
|
|
|
生产环境启动脚本
|
|
|
|
|
使用 waitress 作为 WSGI 服务器
|
|
|
|
|
"""
|
|
|
|
|
import os
|
|
|
|
|
from waitress import serve
|
|
|
|
|
from app import app
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2026-07-21 16:00:46 +08:00
|
|
|
port = int(os.environ.get('DEPLOY_RUN_PORT', 5002))
|
2026-07-21 15:37:36 +08:00
|
|
|
host = os.environ.get('DEPLOY_RUN_HOST', '0.0.0.0')
|
|
|
|
|
|
|
|
|
|
print(f'订单日报系统 - 生产模式')
|
|
|
|
|
print(f'监听地址: {host}:{port}')
|
|
|
|
|
print('按 Ctrl+C 停止服务')
|
|
|
|
|
print('-' * 50)
|
|
|
|
|
|
|
|
|
|
serve(
|
|
|
|
|
app,
|
|
|
|
|
host=host,
|
|
|
|
|
port=port,
|
|
|
|
|
threads=8,
|
|
|
|
|
connection_limit=200,
|
|
|
|
|
channel_timeout=300,
|
|
|
|
|
)
|