diff --git a/README.md b/README.md index 71dc125..a81ed41 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,23 @@ pip install -r requirements.txt ``` ### 2. 启动服务 + +**开发环境** ```bash python app.py ``` 服务默认运行在 `http://127.0.0.1:5000`。 +**生产环境 (Gunicorn)** +在 Linux 生产环境中,建议使用 Gunicorn 作为 WSGI 服务器以获得更好的性能和稳定性: +```bash +pip install gunicorn # 如果尚未安装 +gunicorn -w 4 -b 0.0.0.0:5000 app:app +``` +* `-w 4`: 使用 4 个工作进程(通常设为 CPU 核心数 * 2 + 1)。 +* `-b 0.0.0.0:5000`: 绑定所有 IP 且端口为 5000。 +* `app:app`: 加载 `app.py` 中的 `app` 实例。 + --- ## 🛠️ 常用维护命令 diff --git a/requirements.txt b/requirements.txt index 8b2ee9d..19d1a2d 100644 Binary files a/requirements.txt and b/requirements.txt differ