Files
aiagent/启动说明(红头).md
2026-01-22 09:59:02 +08:00

105 lines
2.2 KiB
Markdown
Raw 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.
# 🚀 启动说明
## 使用 Docker Compose 启动(推荐)
### 1. 启动所有服务
```bash
docker-compose -f docker-compose.dev.yml up -d
```
### 2. 查看服务状态
```bash
docker-compose ps
```
### 3. 查看日志
```bash
# 查看所有服务日志
docker-compose logs -f
# 查看特定服务日志
docker-compose logs -f backend
docker-compose logs -f frontend
docker-compose logs -f celery
```
### 4. 停止服务
```bash
docker-compose down
```
### 5. 重启服务
```bash
docker-compose restart
```
## 📍 访问地址
- **前端**: http://localhost:8038
- **后端API**: http://localhost:8037
- **API文档**: http://localhost:8037/docs
- **健康检查**: http://localhost:8037/health
## 🔧 配置说明
### 数据库配置
- **数据库类型**: MySQL腾讯云数据库
- **连接地址**: gz-cynosdbmysql-grp-d26pzce5.sql.tencentcdb.com:24936
- **数据库名**: agent_db
- **字符集**: utf8mb4
### 端口配置
- **前端端口**: 8038容器内3000
- **后端端口**: 8037容器内8000
- **Redis端口**: 6379
## ⚠️ 注意事项
1. **数据库连接**: 确保服务器能够访问腾讯云MySQL数据库
2. **首次启动**: 首次启动可能需要一些时间下载镜像和安装依赖
3. **数据库迁移**: 首次运行需要执行数据库迁移(如果需要)
4. **环境变量**: 数据库连接信息已在docker-compose.dev.yml中配置
## 🐛 常见问题
### 1. 容器启动失败
检查:
- Docker 和 Docker Compose 是否正常运行
- 端口是否被占用8038, 8037, 6379
- 磁盘空间是否充足
### 2. 数据库连接失败
检查:
- 网络是否能够访问腾讯云数据库
- 数据库连接信息是否正确
- 数据库是否已创建
### 3. 前端无法访问后端
检查:
- 后端服务是否正常运行
- 前端配置的API URL是否正确
- CORS配置是否正确
### 4. Celery任务不执行
检查:
- Celery Worker容器是否正常运行
- Redis连接是否正常
- 查看Celery日志`docker-compose logs -f celery`
## 📝 下一步
1. 访问 http://localhost:8037/docs 查看API文档
2. 开始开发功能模块
3. 参考 [方案-优化版.md](./方案-优化版.md) 了解详细技术方案