mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00
fix: docs
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
---
|
||||
weight: 500
|
||||
title: "开发指南"
|
||||
description: "对 FastGPT 进行开发调试"
|
||||
icon: "developer_guide"
|
||||
title: '开发指南'
|
||||
description: '对 FastGPT 进行开发调试'
|
||||
icon: 'developer_guide'
|
||||
draft: false
|
||||
images: []
|
||||
---
|
||||
@@ -23,7 +23,7 @@ images: []
|
||||
|
||||
要设置一个可工作的开发环境,只需 Fork 项目的 Git 存储库,并部署一个数据库,然后开始进行开发测试。
|
||||
|
||||
### Fork存储库
|
||||
### Fork 存储库
|
||||
|
||||
您需要 Fork [存储库](https://github.com/labring/FastGPT)。
|
||||
|
||||
@@ -49,13 +49,15 @@ client 目录下为 FastGPT 核心代码。NextJS 框架前后端放在一起,
|
||||
|
||||
**2. config 配置文件**
|
||||
|
||||
复制 data/config.json 文件,生成一个 data/config.local.json 配置文件。
|
||||
复制 data/config.json 文件,生成一个 data/config.local.json 配置文件。具体的参数说明,可参考 [config 配置说名](/docs/installation/reference/configuration)
|
||||
|
||||
**注意:json 配置文件不能包含注释,介绍中为了方便看才加入的注释**
|
||||
|
||||
这个文件大部分时候不需要修改。只需要关注 SystemParams 里的参数:
|
||||
|
||||
+ `vectorMaxProcess`: 向量生成最大进程,根据数据库和 key 的并发数来决定,通常单个 120 号,2c4g 服务器设置10~15。
|
||||
+ `qaMaxProcess`: QA 生成最大进程
|
||||
+ `pgIvfflatProbe`: PostgreSQL vector 搜索探针,没有添加 vector 索引时可忽略。
|
||||
- `vectorMaxProcess`: 向量生成最大进程,根据数据库和 key 的并发数来决定,通常单个 120 号,2c4g 服务器设置 10~15。
|
||||
- `qaMaxProcess`: QA 生成最大进程
|
||||
- `pgIvfflatProbe`: PostgreSQL vector 搜索探针,没有添加 vector 索引时可忽略。
|
||||
|
||||
### 运行
|
||||
|
||||
@@ -81,4 +83,4 @@ docker build -t dockername/fastgpt .
|
||||
|
||||
遇到困难了吗?有任何问题吗? 加入微信群与开发者和用户保持沟通。
|
||||
|
||||
<center><image width="400px" src="/wechat-fastgpt.webp" /></center>
|
||||
<center><image width="400px" src="/wechat-fastgpt.webp" /></center>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "Docker Compose 快速部署"
|
||||
description: "使用 Docker Compose 快速部署 FastGPT"
|
||||
icon: ""
|
||||
title: 'Docker Compose 快速部署'
|
||||
description: '使用 Docker Compose 快速部署 FastGPT'
|
||||
icon: ''
|
||||
draft: false
|
||||
toc: true
|
||||
weight: 720
|
||||
@@ -26,6 +26,7 @@ weight: 720
|
||||
{{< tabs tabTotal="3" >}}
|
||||
{{< tab tabName="Linux" >}}
|
||||
{{< markdownify >}}
|
||||
|
||||
```bash
|
||||
# 安装 Docker
|
||||
curl -sSL https://get.daocloud.io/docker | sh
|
||||
@@ -37,6 +38,7 @@ chmod +x /usr/local/bin/docker-compose
|
||||
docker -v
|
||||
docker-compose -v
|
||||
```
|
||||
|
||||
{{< /markdownify >}}
|
||||
{{< /tab >}}
|
||||
{{< tab tabName="MacOS" >}}
|
||||
@@ -49,35 +51,38 @@ brew install orbstack
|
||||
|
||||
或者直接[下载安装包](https://orbstack.dev/download)进行安装。
|
||||
{{< /markdownify >}}
|
||||
{{< /tab >}}
|
||||
{{< /tab >}}
|
||||
{{< tab tabName="Windows" >}}
|
||||
{{< 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 >}}
|
||||
{{< /tab >}}
|
||||
{{< /tabs >}}
|
||||
|
||||
## 创建 docker-compose.yml 文件
|
||||
|
||||
先创建一个目录(例如 fastgpt)并进入该目录:
|
||||
先创建一个目录(例如 fastgpt)并进入该目录,创建一个 docker-compose.yml 文件:
|
||||
|
||||
```bash
|
||||
mkdir fastgpt
|
||||
cd fastgpt
|
||||
touch docker-compose.yml
|
||||
```
|
||||
|
||||
创建一个 docker-compose.yml 文件,粘贴下面的内容:
|
||||
粘贴下面的内容,仅需把 `CHAT_API_KEY` 修改成 openai key 即可。如果需要使用中转或 oneapi 还需要修改 `OPENAI_BASE_URL`:
|
||||
|
||||
```yaml
|
||||
# 非 host 版本, 不使用本机代理
|
||||
version: '3.3'
|
||||
services:
|
||||
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 # 阿里云
|
||||
container_name: pg
|
||||
restart: always
|
||||
@@ -109,8 +114,8 @@ services:
|
||||
- ./mongo/data:/data/db
|
||||
fastgpt:
|
||||
container_name: fastgpt
|
||||
image: ghcr.io/labring/fastgpt:latest # git
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:latest # 阿里云
|
||||
image: ghcr.io/labring/fastgpt:latest # github
|
||||
ports:
|
||||
- 3000:3000
|
||||
networks:
|
||||
@@ -128,21 +133,14 @@ services:
|
||||
- DB_MAX_LINK=5 # database max link
|
||||
- TOKEN_KEY=any
|
||||
- ROOT_KEY=root_key
|
||||
# mongo 配置,不需要改
|
||||
- MONGODB_URI=mongodb://username:password@mongo:27017/?authSource=admin
|
||||
- MONGODB_NAME=fastgpt
|
||||
# pg配置
|
||||
- PG_HOST=pg
|
||||
- PG_PORT=5432
|
||||
- PG_USER=username
|
||||
- PG_PASSWORD=password
|
||||
- PG_DB_NAME=postgres
|
||||
# mongo 配置,不需要改. 如果连不上,可能需要去掉 ?authSource=admin
|
||||
- MONGODB_URI=mongodb://username:password@mongo:27017/fastgpt?authSource=admin
|
||||
# pg配置. 不需要改
|
||||
- PG_URL=postgresql://username:password@pg:5432/postgres
|
||||
networks:
|
||||
fastgpt:
|
||||
```
|
||||
|
||||
> 只需要改 fastgpt 容器的 3 个参数即可启动。
|
||||
|
||||
## 启动容器
|
||||
|
||||
```bash
|
||||
@@ -152,7 +150,7 @@ docker-compose up -d
|
||||
|
||||
## 访问 FastGPT
|
||||
|
||||
目前可以通过 `ip:3000`` 直接访问(注意防火墙)。登录用户名为 `root`,密码为刚刚环境变量里设置的 `DEFAULT_ROOT_PSW`。
|
||||
目前可以通过 ` ip:3000`` 直接访问(注意防火墙)。登录用户名为 `root`,密码为刚刚环境变量里设置的 `DEFAULT_ROOT_PSW`。
|
||||
|
||||
如果需要域名访问,请自行安装并配置 Nginx。
|
||||
|
||||
@@ -239,7 +237,6 @@ docker-compose up -d
|
||||
fastgpt:
|
||||
container_name: fastgpt
|
||||
image: ghcr.io/labring/fastgpt:latest # github
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:latest # 阿里云
|
||||
ports:
|
||||
- 3000:3000
|
||||
networks:
|
||||
@@ -249,10 +246,11 @@ fastgpt:
|
||||
- pg
|
||||
restart: always
|
||||
environment:
|
||||
# root 密码,用户名为: root
|
||||
...
|
||||
- DEFAULT_ROOT_PSW=1234
|
||||
...
|
||||
volumes:
|
||||
- ./config.json:/app/data/config.json
|
||||
```
|
||||
|
||||
> 参考[配置详解](/docs/installation/reference/configuration/)
|
||||
> 参考[配置详解](/docs/installation/reference/configuration/)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "配置详解"
|
||||
description: "FastGPT 配置参数介绍"
|
||||
icon: "settings"
|
||||
title: '配置详解'
|
||||
description: 'FastGPT 配置参数介绍'
|
||||
icon: 'settings'
|
||||
draft: false
|
||||
toc: true
|
||||
weight: 751
|
||||
@@ -9,9 +9,9 @@ weight: 751
|
||||
|
||||
由于环境变量不利于配置复杂的内容,新版 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 对话的模型等……
|
||||
|
||||
@@ -114,4 +114,4 @@ weight: 751
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
```
|
||||
|
Reference in New Issue
Block a user