- Move root-level docs into docs/ directory - Move config files into config/ directory - Move docker files into docker/ directory - Move test scripts into tests/ directory - Remove .env from tracking (use .env.example as template) - Remove .venv/ from tracking (use requirements.txt) - Add Vue3 frontend app (vue-app/) - Add new routes: upload, user_templates, meeting_minutes, etc. - Add database migrations for prompt_template additions - Fix load_dotenv() to use absolute path for Flask reloader compatibility Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37 lines
891 B
Python
37 lines
891 B
Python
#!/usr/bin/env python3
|
||
"""生产环境启动:Waitress WSGI(Windows 友好)。说明见仓库根目录 windows上唯一启动说明.md。"""
|
||
import os
|
||
import sys
|
||
|
||
from waitress import serve
|
||
|
||
from src.flask_prompt_master import create_app
|
||
|
||
|
||
def main() -> None:
|
||
os.environ.setdefault("FLASK_ENV", "production")
|
||
app = create_app()
|
||
port = int(os.environ.get("PORT", "5000"))
|
||
print("=" * 60)
|
||
print("Flask 提示词大师 - 生产环境 (Waitress)")
|
||
print("=" * 60)
|
||
print(f"监听: 0.0.0.0:{port} 按 Ctrl+C 停止")
|
||
print("=" * 60)
|
||
serve(
|
||
app,
|
||
host="0.0.0.0",
|
||
port=port,
|
||
threads=4,
|
||
connection_limit=1000,
|
||
cleanup_interval=30,
|
||
channel_timeout=120,
|
||
max_request_body_size=1073741824,
|
||
)
|
||
|
||
|
||
if __name__ == "__main__":
|
||
try:
|
||
main()
|
||
except KeyboardInterrupt:
|
||
sys.exit(0)
|