Skip to content

Commit 4012ef6

Browse files
author
keqian
committed
feat: 更新readme
1 parent c96bf1e commit 4012ef6

File tree

3 files changed

+52
-36
lines changed

3 files changed

+52
-36
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,6 @@ secrets.json
202202
.env.production
203203

204204
# Local development
205-
local_*
205+
local_*
206+
.python-version
207+
qdrant_data

DOCKER.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ MICROSOFT_TTS_KEY=your_azure_tts_key
3232

3333
```bash
3434
# 构建并启动所有服务
35+
cd /Users/king/Develop/self/mystical-oracle
3536
docker-compose up -d
3637

3738
# 查看服务状态
@@ -109,24 +110,24 @@ docker-compose exec mystical-oracle bash
109110
1. **Ollama 模型下载失败**
110111
```bash
111112
# 手动下载模型
112-
docker-compose exec ollama ollama pull qwen2.5:latest
113+
docker-compose exec ollama ollama pull qwen2.5:latest
113114
```
114115

115116
2. **端口冲突**
116117
```bash
117118
# 修改 docker-compose.yml 中的端口映射
118-
ports:
119-
- "8001:8000" # 将宿主机端口改为 8001
119+
ports:
120+
- "8001:8000" # 将宿主机端口改为 8001
120121
```
121122

122123
3. **内存不足**
123124
```bash
124125
# 增加 Docker 内存限制或使用更小的模型
125-
# 在 docker-compose.yml 中添加:
126-
deploy:
127-
resources:
128-
limits:
129-
memory: 4G
126+
# 在 docker-compose.yml 中添加:
127+
deploy:
128+
resources:
129+
limits:
130+
memory: 4G
130131
```
131132

132133
### 日志查看
@@ -175,6 +176,14 @@ deploy:
175176
176177
## 扩展部署
177178
179+
### 单容器部署
180+
181+
如果您需要更简单的部署方式,可以使用单容器部署:
182+
183+
```bash
184+
docker-compose -f docker-compose.single.yml up -d
185+
```
186+
178187
### 多实例部署
179188

180189
```bash
@@ -202,16 +211,14 @@ server {
202211
}
203212
```
204213

205-
## 安全建议
214+
## 部署注意事项
206215

207-
1. **不要在生产环境暴露所有端口**
208-
2. **使用强密码和 API 密钥**
209-
3. **启用 HTTPS**
210-
4. **定期更新镜像**
211-
5. **配置防火墙规则**
216+
- 确保防火墙已开放所需端口
217+
- 在生产环境中,建议使用 HTTPS 加密通信
218+
- 定期备份持久化数据卷
219+
- 对于高流量场景,考虑使用 Kubernetes 进行容器编排
220+
- 监控系统资源使用情况,及时调整资源限制
212221

213-
```bash
214-
# 只暴露必要端口
215-
ports:
216-
- "127.0.0.1:8000:8000" # 只允许本地访问
217-
```
222+
---
223+
224+
使用 Docker 部署可以大大简化环境配置和依赖管理,让您专注于使用和扩展 Mystical Oracle 服务。

README.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,26 @@ mystical-oracle/
2121
├── agent.py # 核心 Agent 类
2222
├── server.py # FastAPI Web 服务器
2323
├── config/ # 配置管理
24-
│ ├── settings.py # 系统配置
25-
│ └── keys.py # API 密钥管理
26-
├── prompts/ # 提示词模板
27-
│ ├── system_prompts.py # 系统提示词
28-
│ └── mood_prompts.py # 情绪相关提示词
29-
├── services/ # 业务服务
30-
│ ├── tools.py # 工具函数集合
31-
│ └── tts_service.py # 语音合成服务
32-
├── models/ # 数据模型
33-
│ └── user.py # 用户数据模型
34-
├── utils/ # 工具函数
35-
│ └── helpers.py # 辅助函数
36-
├── requirements.txt # 依赖包列表
37-
└── README.md # 项目说明文档
24+
│ ├── __init__.py
25+
│ ├── logger.py
26+
│ └── settings.py # 系统配置和密钥管理
27+
├── prompts/ # 提示词模板
28+
│ ├── __init__.py
29+
│ ├── mood_prompts.py # 情绪相关提示词
30+
│ └── system_prompts.py # 系统提示词
31+
├── services/ # 业务服务
32+
│ ├── tools.py # 工具函数集合
33+
│ └── tts_service.py # 语音合成服务
34+
├── models/ # 数据模型
35+
│ └── user.py # 用户数据模型
36+
├── utils/ # 工具函数
37+
│ └── helpers.py # 辅助函数
38+
├── requirements.txt # 依赖包列表
39+
├── README.md # 项目说明文档
40+
├── DOCKER.md # Docker 部署文档
41+
├── Dockerfile # Docker 构建文件
42+
├── docker-compose.yml # Docker Compose 配置
43+
└── docker-compose.single.yml # 单容器部署配置
3844
```
3945

4046
## 环境要求
@@ -48,7 +54,8 @@ mystical-oracle/
4854

4955
1. **克隆项目**
5056
```bash
51-
cd /Users/king/Develop/self/mystical-oracle
57+
git clone <repository-url>
58+
cd mystical-oracle
5259
```
5360

5461
2. **安装依赖**
@@ -139,7 +146,7 @@ python server.py
139146
- 系统提示词设置
140147

141148
### API 密钥管理
142-
`config/keys.py` 中集中管理所有 API 密钥,支持环境变量和默认值。
149+
所有 API 密钥在 `config/settings.py` 中集中管理,支持环境变量和默认值。
143150

144151
### 提示词模板
145152
`prompts/` 目录下管理所有提示词模板,便于维护和调整。

0 commit comments

Comments
 (0)