From f70a988574c42fdea92b4c4b30311ee77ba87678 Mon Sep 17 00:00:00 2001 From: archer <545436317@qq.com> Date: Thu, 10 Aug 2023 13:11:39 +0800 Subject: [PATCH] perf: docs --- docSite/docs/develop/deploy/docker.md | 93 ++++++++++++++++++- .../current/develop/deploy/docker.md | 93 ++++++++++++++++++- files/deploy/fastgpt/config.json | 64 +++++++++++++ files/deploy/fastgpt/docker-compose.yml | 6 +- 4 files changed, 251 insertions(+), 5 deletions(-) create mode 100644 files/deploy/fastgpt/config.json diff --git a/docSite/docs/develop/deploy/docker.md b/docSite/docs/develop/deploy/docker.md index fd11fe5fd..04695c84a 100644 --- a/docSite/docs/develop/deploy/docker.md +++ b/docSite/docs/develop/deploy/docker.md @@ -97,7 +97,6 @@ services: - PG_USER=username - PG_PASSWORD=password - PG_DB_NAME=postgres - networks: fastgpt: ``` @@ -179,3 +178,95 @@ docker-compose up -d ### 1. 如何更新? 执行 `docker-compose up -d` 会自动拉取最新镜像,一般情况下不需要执行额外操作。 + +### 2. 挂载配置文件 + +在和 `docker-compose.yml` 同级目录,创建一个 `config.json` 文件,内容如下: + +```json +{ + "FeConfig": { + "show_emptyChat": true, + "show_register": false, + "show_appStore": false, + "show_userDetail": false, + "show_git": true, + "systemTitle": "FastGPT", + "authorText": "Made by FastGPT Team.", + "gitLoginKey": "", + "scripts": [] + }, + "SystemParams": { + "gitLoginSecret": "", + "vectorMaxProcess": 15, + "qaMaxProcess": 15, + "pgIvfflatProbe": 20 + }, + "plugins": {}, + "ChatModels": [ + { + "model": "gpt-3.5-turbo", + "name": "GPT35-4k", + "contextMaxToken": 4000, + "quoteMaxToken": 2000, + "maxTemperature": 1.2, + "price": 0, + "defaultSystem": "" + }, + { + "model": "gpt-3.5-turbo-16k", + "name": "GPT35-16k", + "contextMaxToken": 16000, + "quoteMaxToken": 8000, + "maxTemperature": 1.2, + "price": 0, + "defaultSystem": "" + }, + { + "model": "gpt-4", + "name": "GPT4-8k", + "contextMaxToken": 8000, + "quoteMaxToken": 4000, + "maxTemperature": 1.2, + "price": 0, + "defaultSystem": "" + } + ], + "QAModels": [ + { + "model": "gpt-3.5-turbo-16k", + "name": "GPT35-16k", + "maxToken": 16000, + "price": 0 + } + ], + "VectorModels": [ + { + "model": "text-embedding-ada-002", + "name": "Embedding-2", + "price": 0 + } + ] +} +``` + +修改 docker-compose.yml 中 fastgpt 容器内容,增加挂载。具体配置可参考 [config 配置说明](/docs/category/data-config) + +```yml +fastgpt: + container_name: fastgpt + image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:latest # 阿里云 + ports: + - 3000:3000 + networks: + - fastgpt + depends_on: + - mongo + - pg + restart: always + environment: + # root 密码,用户名为: root + - DEFAULT_ROOT_PSW=1234 + volumes: + - ./config.json:/app/data/config.json +``` diff --git a/docSite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/develop/deploy/docker.md b/docSite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/develop/deploy/docker.md index fd11fe5fd..04695c84a 100644 --- a/docSite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/develop/deploy/docker.md +++ b/docSite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/develop/deploy/docker.md @@ -97,7 +97,6 @@ services: - PG_USER=username - PG_PASSWORD=password - PG_DB_NAME=postgres - networks: fastgpt: ``` @@ -179,3 +178,95 @@ docker-compose up -d ### 1. 如何更新? 执行 `docker-compose up -d` 会自动拉取最新镜像,一般情况下不需要执行额外操作。 + +### 2. 挂载配置文件 + +在和 `docker-compose.yml` 同级目录,创建一个 `config.json` 文件,内容如下: + +```json +{ + "FeConfig": { + "show_emptyChat": true, + "show_register": false, + "show_appStore": false, + "show_userDetail": false, + "show_git": true, + "systemTitle": "FastGPT", + "authorText": "Made by FastGPT Team.", + "gitLoginKey": "", + "scripts": [] + }, + "SystemParams": { + "gitLoginSecret": "", + "vectorMaxProcess": 15, + "qaMaxProcess": 15, + "pgIvfflatProbe": 20 + }, + "plugins": {}, + "ChatModels": [ + { + "model": "gpt-3.5-turbo", + "name": "GPT35-4k", + "contextMaxToken": 4000, + "quoteMaxToken": 2000, + "maxTemperature": 1.2, + "price": 0, + "defaultSystem": "" + }, + { + "model": "gpt-3.5-turbo-16k", + "name": "GPT35-16k", + "contextMaxToken": 16000, + "quoteMaxToken": 8000, + "maxTemperature": 1.2, + "price": 0, + "defaultSystem": "" + }, + { + "model": "gpt-4", + "name": "GPT4-8k", + "contextMaxToken": 8000, + "quoteMaxToken": 4000, + "maxTemperature": 1.2, + "price": 0, + "defaultSystem": "" + } + ], + "QAModels": [ + { + "model": "gpt-3.5-turbo-16k", + "name": "GPT35-16k", + "maxToken": 16000, + "price": 0 + } + ], + "VectorModels": [ + { + "model": "text-embedding-ada-002", + "name": "Embedding-2", + "price": 0 + } + ] +} +``` + +修改 docker-compose.yml 中 fastgpt 容器内容,增加挂载。具体配置可参考 [config 配置说明](/docs/category/data-config) + +```yml +fastgpt: + container_name: fastgpt + image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:latest # 阿里云 + ports: + - 3000:3000 + networks: + - fastgpt + depends_on: + - mongo + - pg + restart: always + environment: + # root 密码,用户名为: root + - DEFAULT_ROOT_PSW=1234 + volumes: + - ./config.json:/app/data/config.json +``` diff --git a/files/deploy/fastgpt/config.json b/files/deploy/fastgpt/config.json new file mode 100644 index 000000000..64ffebc40 --- /dev/null +++ b/files/deploy/fastgpt/config.json @@ -0,0 +1,64 @@ +{ + "FeConfig": { + "show_emptyChat": true, + "show_register": false, + "show_appStore": false, + "show_userDetail": false, + "show_git": true, + "systemTitle": "FastGPT", + "authorText": "Made by FastGPT Team.", + "gitLoginKey": "", + "scripts": [] + }, + "SystemParams": { + "gitLoginSecret": "", + "vectorMaxProcess": 15, + "qaMaxProcess": 15, + "pgIvfflatProbe": 20 + }, + "plugins": {}, + "ChatModels": [ + { + "model": "gpt-3.5-turbo", + "name": "GPT35-4k", + "contextMaxToken": 4000, + "quoteMaxToken": 2000, + "maxTemperature": 1.2, + "price": 0, + "defaultSystem": "" + }, + { + "model": "gpt-3.5-turbo-16k", + "name": "GPT35-16k", + "contextMaxToken": 16000, + "quoteMaxToken": 8000, + "maxTemperature": 1.2, + "price": 0, + "defaultSystem": "" + }, + { + "model": "gpt-4", + "name": "GPT4-8k", + "contextMaxToken": 8000, + "quoteMaxToken": 4000, + "maxTemperature": 1.2, + "price": 0, + "defaultSystem": "" + } + ], + "QAModels": [ + { + "model": "gpt-3.5-turbo-16k", + "name": "GPT35-16k", + "maxToken": 16000, + "price": 0 + } + ], + "VectorModels": [ + { + "model": "text-embedding-ada-002", + "name": "Embedding-2", + "price": 0 + } + ] +} diff --git a/files/deploy/fastgpt/docker-compose.yml b/files/deploy/fastgpt/docker-compose.yml index 732fe369e..43a7b8657 100644 --- a/files/deploy/fastgpt/docker-compose.yml +++ b/files/deploy/fastgpt/docker-compose.yml @@ -62,10 +62,10 @@ services: - PG_USER=username - PG_PASSWORD=password - PG_DB_NAME=postgres - + volumes: + - ./config.json:/app/data/config.json networks: fastgpt: - # host 版本, 不推荐。 # version: '3.3' # services: @@ -123,4 +123,4 @@ networks: # - PG_PORT=5432 # - PG_USER=username # - PG_PASSWORD=password -# - PG_DB_NAME=postgres \ No newline at end of file +# - PG_DB_NAME=postgres