ForcePilot/docs/advanced/deployment.md
Wenjie Zhang 62bb928064 refactor: 更新文档部署说明
- 移除对于双版本文档的支持,更加清晰
- 将 docs 的入口从根目录移动到子目录
2026-03-24 11:09:46 +08:00

71 lines
1.5 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.

# 生产部署指南
本文档介绍如何在生产环境中部署 Yuxi。
## 前置要求
- Docker Engine (v24.0+)
- Docker Compose (v2.20+)
- NVIDIA Container Toolkit如需使用 GPU 服务)
::: warning 注意事项
1. 生产环境和开发环境建议使用不同的机器,避免端口和资源冲突
2. 虽然名为「生产环境」,但这只是基本配置,真正上线需要根据实际情况调整
3. 前端有调试面板(长按侧边栏触发),生产环境建议关闭
:::
## 部署步骤
### 1. 准备配置文件
为避免与开发环境冲突,生产环境建议使用 `.env.prod` 文件:
```bash
cp .env.template .env.prod
```
编辑 `.env.prod`,设置强密码和必要的 API 密钥:
- `NEO4J_PASSWORD`:修改默认密码
- `MINIO_ACCESS_KEY` / `MINIO_SECRET_KEY`:修改默认密钥
- `SILICONFLOW_API_KEY` 等模型密钥
### 2. 启动服务
使用生产环境配置文件启动:
```bash
# 仅启动核心服务CPU 模式)
docker compose -f docker-compose.prod.yml up -d --build
# 启动所有服务(包含 GPU OCR
docker compose -f docker-compose.prod.yml --profile all up -d --build
```
### 3. 验证部署
- Web 访问http://localhost直接通过 80 端口)
- API 健康检查:`curl http://localhost/api/system/health`
## 维护与更新
### 更新代码
```bash
# 拉取最新代码
git pull
# 重新构建并启动
docker compose -f docker-compose.prod.yml up -d --build
```
### 查看日志
```bash
# API 日志
docker logs -f api-prod
# Nginx 访问日志
docker logs -f web-prod
```