fix: docs

This commit is contained in:
archer
2023-08-24 08:30:09 +08:00
parent a5c8f34706
commit 34ab66bb69
3 changed files with 41 additions and 41 deletions

View File

@@ -1,8 +1,8 @@
--- ---
weight: 500 weight: 500
title: "开发指南" title: '开发指南'
description: "对 FastGPT 进行开发调试" description: '对 FastGPT 进行开发调试'
icon: "developer_guide" icon: 'developer_guide'
draft: false draft: false
images: [] images: []
--- ---
@@ -49,13 +49,15 @@ client 目录下为 FastGPT 核心代码。NextJS 框架前后端放在一起,
**2. config 配置文件** **2. config 配置文件**
复制 data/config.json 文件,生成一个 data/config.local.json 配置文件。 复制 data/config.json 文件,生成一个 data/config.local.json 配置文件。具体的参数说明,可参考 [config 配置说名](/docs/installation/reference/configuration)
**注意json 配置文件不能包含注释,介绍中为了方便看才加入的注释**
这个文件大部分时候不需要修改。只需要关注 SystemParams 里的参数: 这个文件大部分时候不需要修改。只需要关注 SystemParams 里的参数:
+ `vectorMaxProcess`: 向量生成最大进程,根据数据库和 key 的并发数来决定,通常单个 120 号2c4g 服务器设置10~15。 - `vectorMaxProcess`: 向量生成最大进程,根据数据库和 key 的并发数来决定,通常单个 120 号2c4g 服务器设置 10~15。
+ `qaMaxProcess`: QA 生成最大进程 - `qaMaxProcess`: QA 生成最大进程
+ `pgIvfflatProbe`: PostgreSQL vector 搜索探针,没有添加 vector 索引时可忽略。 - `pgIvfflatProbe`: PostgreSQL vector 搜索探针,没有添加 vector 索引时可忽略。
### 运行 ### 运行

View File

@@ -1,7 +1,7 @@
--- ---
title: "Docker Compose 快速部署" title: 'Docker Compose 快速部署'
description: "使用 Docker Compose 快速部署 FastGPT" description: '使用 Docker Compose 快速部署 FastGPT'
icon: "" icon: ''
draft: false draft: false
toc: true toc: true
weight: 720 weight: 720
@@ -26,6 +26,7 @@ weight: 720
{{< tabs tabTotal="3" >}} {{< tabs tabTotal="3" >}}
{{< tab tabName="Linux" >}} {{< tab tabName="Linux" >}}
{{< markdownify >}} {{< markdownify >}}
```bash ```bash
# 安装 Docker # 安装 Docker
curl -sSL https://get.daocloud.io/docker | sh curl -sSL https://get.daocloud.io/docker | sh
@@ -37,6 +38,7 @@ chmod +x /usr/local/bin/docker-compose
docker -v docker -v
docker-compose -v docker-compose -v
``` ```
{{< /markdownify >}} {{< /markdownify >}}
{{< /tab >}} {{< /tab >}}
{{< tab tabName="MacOS" >}} {{< tab tabName="MacOS" >}}
@@ -52,32 +54,35 @@ brew install orbstack
{{< /tab >}} {{< /tab >}}
{{< tab tabName="Windows" >}} {{< tab tabName="Windows" >}}
{{< markdownify >}} {{< markdownify >}}
我们建议将源代码和其他数据绑定到 Linux 容器中时,将其存储在 Linux 文件系统中,而不是 Windows 文件系统中。
可以选择直接[使用 WSL 2 后端Windows 中安装 Docker Desktop](https://docs.docker.com/desktop/wsl/) > 我们建议将源代码和其他数据绑定到 Linux 容器中时,将其存储Linux 文件系统中,而不是 Windows 文件系统中
>
> 可以选择直接[使用 WSL 2 后端在 Windows 中安装 Docker Desktop](https://docs.docker.com/desktop/wsl/)。
>
> 也可以直接[在 WSL 2 中安装命令行版本的 Docker](https://nickjanetakis.com/blog/install-docker-in-wsl-2-without-docker-desktop)。
也可以直接[在 WSL 2 中安装命令行版本的 Docker](https://nickjanetakis.com/blog/install-docker-in-wsl-2-without-docker-desktop)。
{{< /markdownify >}} {{< /markdownify >}}
{{< /tab >}} {{< /tab >}}
{{< /tabs >}} {{< /tabs >}}
## 创建 docker-compose.yml 文件 ## 创建 docker-compose.yml 文件
先创建一个目录(例如 fastgpt并进入该目录 先创建一个目录(例如 fastgpt并进入该目录,创建一个 docker-compose.yml 文件
```bash ```bash
mkdir fastgpt mkdir fastgpt
cd fastgpt cd fastgpt
touch docker-compose.yml
``` ```
创建一个 docker-compose.yml 文件,粘贴下面的内容: 粘贴下面的内容,仅需把 `CHAT_API_KEY` 修改成 openai key 即可。如果需要使用中转或 oneapi 还需要修改 `OPENAI_BASE_URL`:
```yaml ```yaml
# 非 host 版本, 不使用本机代理 # 非 host 版本, 不使用本机代理
version: '3.3' version: '3.3'
services: services:
pg: pg:
image: ankane/pgvector:v0.4.2 image: ankane/pgvector:v0.4.2 # docker
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.4.2 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.4.2 # 阿里云
container_name: pg container_name: pg
restart: always restart: always
@@ -109,8 +114,8 @@ services:
- ./mongo/data:/data/db - ./mongo/data:/data/db
fastgpt: fastgpt:
container_name: fastgpt container_name: fastgpt
image: ghcr.io/labring/fastgpt:latest # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:latest # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:latest # 阿里云
image: ghcr.io/labring/fastgpt:latest # github
ports: ports:
- 3000:3000 - 3000:3000
networks: networks:
@@ -128,21 +133,14 @@ services:
- DB_MAX_LINK=5 # database max link - DB_MAX_LINK=5 # database max link
- TOKEN_KEY=any - TOKEN_KEY=any
- ROOT_KEY=root_key - ROOT_KEY=root_key
# mongo 配置,不需要改 # mongo 配置,不需要改. 如果连不上,可能需要去掉 ?authSource=admin
- MONGODB_URI=mongodb://username:password@mongo:27017/?authSource=admin - MONGODB_URI=mongodb://username:password@mongo:27017/fastgpt?authSource=admin
- MONGODB_NAME=fastgpt # pg配置. 不需要改
# pg配置 - PG_URL=postgresql://username:password@pg:5432/postgres
- PG_HOST=pg
- PG_PORT=5432
- PG_USER=username
- PG_PASSWORD=password
- PG_DB_NAME=postgres
networks: networks:
fastgpt: fastgpt:
``` ```
> 只需要改 fastgpt 容器的 3 个参数即可启动。
## 启动容器 ## 启动容器
```bash ```bash
@@ -239,7 +237,6 @@ docker-compose up -d
fastgpt: fastgpt:
container_name: fastgpt container_name: fastgpt
image: ghcr.io/labring/fastgpt:latest # github image: ghcr.io/labring/fastgpt:latest # github
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:latest # 阿里云
ports: ports:
- 3000:3000 - 3000:3000
networks: networks:
@@ -249,8 +246,9 @@ fastgpt:
- pg - pg
restart: always restart: always
environment: environment:
# root 密码,用户名为: root ...
- DEFAULT_ROOT_PSW=1234 - DEFAULT_ROOT_PSW=1234
...
volumes: volumes:
- ./config.json:/app/data/config.json - ./config.json:/app/data/config.json
``` ```

View File

@@ -1,7 +1,7 @@
--- ---
title: "配置详解" title: '配置详解'
description: "FastGPT 配置参数介绍" description: 'FastGPT 配置参数介绍'
icon: "settings" icon: 'settings'
draft: false draft: false
toc: true toc: true
weight: 751 weight: 751
@@ -9,9 +9,9 @@ weight: 751
由于环境变量不利于配置复杂的内容,新版 FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在 `client/data/config.json` 看到默认的配置文件。可以参考 [docker-compose 快速部署](/docs/installation/docker/) 来挂载配置文件。 由于环境变量不利于配置复杂的内容,新版 FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在 `client/data/config.json` 看到默认的配置文件。可以参考 [docker-compose 快速部署](/docs/installation/docker/) 来挂载配置文件。
开发环境下,你需要将示例配置文件 `config.json` 复制成 `config.local.json` 文件才会生效。 **开发环境下**,你需要将示例配置文件 `config.json` 复制成 `config.local.json` 文件才会生效。
注意: 为了方便介绍,文档介绍里会把注释写到 json 文件,实际运行时候 json 文件不能包含注释。 **注意: 为了方便介绍,文档介绍里会把注释写到 json 文件,实际运行时候 json 文件不能包含注释。**
这个配置文件中包含了前端页面定制、系统级参数、AI 对话的模型等…… 这个配置文件中包含了前端页面定制、系统级参数、AI 对话的模型等……