Files
tianxuan-company/docker-deploy.md
Jowe 3c0fbd5059 feat: 集成 DeepSeek AI 服务
- 新增 backend 服务 (Express + TypeScript)
- 前端表单提交改为调用后端 API
- DeepSeek 增强分析结果,本地规则作为 fallback
- Docker 双容器部署:web (Nginx) + backend
- Nginx 反向代理 /api 到后端服务
- 本地开发支持 Vite 代理 + backend:dev 脚本

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 01:37:52 +08:00

70 lines
1.1 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 部署配置
## 快速部署
### 首次部署
```bash
# 1. 拉取代码
git pull
# 2. 配置环境变量
cp .env.example .env
# 编辑 .env至少填入 DEEPSEEK_API_KEY
# 3. 构建并启动容器
docker-compose up -d --build
# 4. 查看日志
docker-compose logs -f
```
### 更新部署
```bash
# 1. 拉取最新代码
git pull
# 2. 重新构建并重启
docker-compose up -d --build
```
### 常用命令
```bash
# 启动
docker-compose up -d
# 停止
docker-compose down
# 重启
docker-compose restart
# 查看状态
docker-compose ps
# 查看日志
docker-compose logs -f
# 查看实时资源
docker stats
```
## 服务结构
- `web`: Nginx 托管前端静态资源,并把 `/api/*` 转发到 backend
- `backend`: Node + Express 服务,负责调用 DeepSeek
## 端口配置
- web 容器内80 (Nginx)
- backend 容器内3000 (Node)
- 宿主机映射8801
## 1Panel 反向代理配置
目标地址:`http://127.0.0.1:8801`
## 环境说明
- 前端Node 20-alpine 构建 + Nginx alpine 运行
- 后端Node 20-alpine 运行
- DeepSeek 密钥仅放在 `.env`,不要写入前端代码