mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-13 14:29:40 +00:00
update deploy doc (#5723)
This commit is contained in:
@@ -1,21 +1,25 @@
|
||||
## 更新 docker compose 脚本
|
||||
|
||||
### 正常更新(不动服务,只改版本)
|
||||
|
||||
1. 更新 `args.json` 中的版本号
|
||||
2. 在 `FastGPT` 目录执行 `pnpm run gen:deploy` 即可
|
||||
|
||||
### 加服务
|
||||
|
||||
比如要添加 `example` 服务:
|
||||
1. init.mjs 的 Services Enum 中添加 example
|
||||
2. 更新 templates/docker-compose.[dev|prod].yml 文件,把服务的相关配置加进去,并且:服务的 image 改为 ${{example.image}}:${{example.tag}}
|
||||
3. 在 `args.json` 中添加 image 和 tag, 注意名字要和 `Service Enum` 中声明的一样才能被正确替换
|
||||
1. `init.mjs` 的 `Services Enum` 中添加 fastgptExample: fastgpt-example
|
||||
2. 在 `args.json` 中添加 image 和 tag, 注意 `args.json` 的 `key` 值,要和 `init.mjs` 的 `value` 值一致。
|
||||
3. 更新 templates/docker-compose.[dev|prod].yml 文件,把服务的相关配置加进去,并且:服务的 image 改为 ${{example.image}}:${{example.tag}}
|
||||
|
||||
### 加向量库
|
||||
|
||||
比如添加 `exampleDB` 向量库:
|
||||
1. 添加 vector service 配置在 `templates/vector` 下面,例如 `templates/vector/exampleDB.txt` 内容可以参考其他 txt,注意缩进,image 名字也要替换成 ${{exampleDB.image}}:${{exampleDB:tag}}
|
||||
2. 在 `args.json` 中添加 `exampleDB` 的配置
|
||||
3. init.mjs vector enum 中添加 `vector`
|
||||
4. init.mjs 中添加 vector 的相关配置:
|
||||
|
||||
```ts
|
||||
const vector = {
|
||||
// pg, milvus, ob ...
|
||||
@@ -28,7 +32,9 @@ const vector = {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
5. init.mjs 读入 vector 配置
|
||||
|
||||
```json
|
||||
{ // 这是个块作用域, 直接搜 read in Vectors
|
||||
// read in Vectors
|
||||
@@ -37,6 +43,7 @@ const vectordb = fs.readFileSync(path.join(process.cwd(), 'templates', 'vector',
|
||||
vector.vector.db = String(vectordb);
|
||||
}
|
||||
```
|
||||
|
||||
6. init.mjs 最后生成的时候,需要添加
|
||||
```ts
|
||||
fs.promises.writeFile(
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
@@ -5,9 +5,9 @@
|
||||
# - 建议修改账密后再运行
|
||||
|
||||
# plugin auth token
|
||||
x-plugin-auth-token: &x-plugin-auth-token token
|
||||
x-plugin-auth-token: &x-plugin-auth-token 'token'
|
||||
# aiproxy token
|
||||
x-aiproxy-token: &x-aiproxy-token token
|
||||
x-aiproxy-token: &x-aiproxy-token 'token'
|
||||
# 数据库连接相关配置
|
||||
x-share-db-config: &x-share-db-config
|
||||
MONGODB_URI: mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
|
Reference in New Issue
Block a user