增加发布正式版的命令

This commit is contained in:
2026-07-21 15:37:36 +08:00
parent cff1074474
commit 22f9bccb09
8 changed files with 371 additions and 29 deletions

25
run_prod.py Normal file
View File

@@ -0,0 +1,25 @@
"""
生产环境启动脚本
使用 waitress 作为 WSGI 服务器
"""
import os
from waitress import serve
from app import app
if __name__ == '__main__':
port = int(os.environ.get('DEPLOY_RUN_PORT', 5000))
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,
)