Files
ai-talk-callback/START_GUIDE.md
2025-12-08 09:49:36 +08:00

59 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 启动说明
## 启动模式
现在所有启动都通过 `main.py` 完成,支持以下模式:
### 1. 仅启动 API 服务
```bash
python main.py --mode api
# 或者
python main.py
```
### 2. 仅启动 Celery Worker
```bash
python main.py --mode worker
```
### 3. 仅启动 Celery Beat 调度器
```bash
python main.py --mode beat
```
### 4. 启动完整服务栈 (API + Worker + Beat)
```bash
python main.py --mode all
```
## 开发环境启动
开发环境下推荐使用 `all` 模式:
```bash
python main.py --mode all
```
这将在同一个进程中启动:
- FastAPI 应用 (端口 8000)
- Celery Worker (后台线程)
- Celery Beat 调度器 (后台线程)
## 生产环境启动
生产环境下建议分别启动各个组件:
```bash
# 终端1: 启动 API
python main.py --mode api
# 终端2: 启动 Worker
python main.py --mode worker
# 终端3: 启动 Beat
python main.py --mode beat
```
## 注意事项
- 使用 `--mode all` 时,Celery Worker 和 Beat 运行在后台线程中,适合开发和测试
- 生产环境建议使用进程管理工具 (如 systemd, supervisor) 分别管理各个进程
- 日志会统一输出到配置的日志文件中