Commit 9c8b935c by Xianquan Committed by GitHub

docs: update 4.15.0 upgrade migrations (#7163)

* docs: update 4.15.0 upgrade guide

* docs: remove config json guide

* docs: add standalone sandbox deployment files

* doc

* yml

* doc

* action

* fix: test

* doc

* yml

---------

Co-authored-by: archer <545436317@qq.com>
parent 759fb3e4
name: Build fastgpt-code-sandbox images
on:
workflow_dispatch:
inputs:
version:
description: 'Image version tag (e.g. v4.15.0)'
required: true
type: string
push:
paths:
- 'projects/code-sandbox/**'
......@@ -15,14 +20,27 @@ jobs:
- name: Validate release version
id: version
env:
VERSION: ${{ github.ref_name }}
VERSION_INPUT: ${{ github.event.inputs.version }}
REF_TYPE: ${{ github.ref_type }}
REF_NAME: ${{ github.ref_name }}
EVENT_NAME: ${{ github.event_name }}
CURRENT_REF: ${{ github.ref }}
run: |
if [[ "$REF_TYPE" != "tag" || ! "$VERSION" =~ ^v ]]; then
if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then
VERSION="$VERSION_INPUT"
else
VERSION="$REF_NAME"
if [[ "$REF_TYPE" != "tag" ]]; then
echo "::error::Release workflow must run on a tag starting with v. Current ref: ${CURRENT_REF}"
exit 1
fi
fi
if [[ ! "$VERSION" =~ ^v ]]; then
echo "::error::Image version must start with v. Current value: ${VERSION}"
exit 1
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
build-fastgpt-code-sandbox-images:
......@@ -134,24 +152,25 @@ jobs:
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests
timeout-minutes: 30
run: |
retry_imagetools_create() {
local tag="$1"
local sources
sources="$(printf 'ghcr.io/${{ github.repository_owner }}/fastgpt-code-sandbox@sha256:%s ' *)"
for attempt in 1 2 3 4; do
for attempt in 1 2 3 4 5 6; do
if docker buildx imagetools create -t "$tag" $sources; then
return 0
fi
if [ "$attempt" -eq 4 ]; then
echo "::error::Failed to push manifest ${tag} after 3 retries."
if [ "$attempt" -eq 6 ]; then
echo "::error::Failed to push manifest ${tag} after 5 retries."
return 1
fi
echo "::warning::Failed to push manifest ${tag}; retrying in $((attempt * 15)) seconds (${attempt}/3)."
sleep $((attempt * 15))
echo "::warning::Failed to push manifest ${tag}; retrying in $((attempt * 60)) seconds (${attempt}/5)."
sleep $((attempt * 60))
done
}
......
......@@ -46,6 +46,10 @@
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"yaml.format.enable": false,
"[yaml]": {
"editor.formatOnSave": false,
},
"mdx.server.enable": true,
"markdown.copyFiles.overwriteBehavior": "nameIncrementally",
"markdown.copyFiles.destination": {
......
......@@ -179,7 +179,7 @@ services:
retries: 3
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0
ports:
- 3002:3000
networks:
......@@ -235,7 +235,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
ports:
- 3003:3000
networks:
......@@ -245,7 +245,7 @@ services:
<<: [*x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.6.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
ports:
......@@ -341,7 +341,7 @@ services:
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.5.8
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
ports:
......
......@@ -179,7 +179,7 @@ services:
retries: 3
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0-beta1
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0
ports:
- 3002:3000
networks:
......@@ -235,7 +235,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.15.0-beta1
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
ports:
- 3003:3000
networks:
......@@ -245,7 +245,7 @@ services:
<<: [*x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v0.6.2
image: ghcr.io/labring/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
ports:
......@@ -341,7 +341,7 @@ services:
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.5.8
image: ghcr.io/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
ports:
......
......@@ -175,18 +175,20 @@ const loadArgs = (version) => {
};
/**
* replace all ${{}}
* 替换模板中的占位符。
*
* YAML 块占位符应写成独立注释行(如 `# ${{vec.db}}`),这样模板文件本身
* 仍能按 YAML 解析;普通镜像/tag 变量仍可写在行内。
*
* @param {string} source
* @param {RegionEnum} region
* @param {string | undefined} vec
* @param {Record<Services, ArgItemType>} args
* @param {Record<string, { filename: string, db: string, config: string, extra: string }>} vectors
* @param {Record<string, { filename: string, db: string, config: string, extra: string, extraBlock: string }>} vectors
* @returns {string}
*/
const replace = (source, region, vec, args, vectors) => {
// Match ${{expr}}, capture "expr" inside {{}}
return source.replace(/\$\{\{([^}]*)\}\}/g, (_, expr) => {
// expr: a.b
const resolveExpr = (expr) => {
/**
* @type {String}
*/
......@@ -208,7 +210,14 @@ const replace = (source, region, vec, args, vectors) => {
} else if (b === 'image') {
return args[a].image[region];
}
});
};
return source
.replace(/^[^\S\r\n]*#\s*\$\{\{([^}]*)\}\}[^\S\r\n]*(?:\r?\n|$)/gm, (_, expr) => {
const value = resolveExpr(expr);
return value ? `${value}\n` : '';
})
.replace(/\$\{\{([^}]*)\}\}/g, (_, expr) => resolveExpr(expr));
};
const formatYamlOutput = (source) => `${source.trimEnd()}\n`;
......
{
"tags": {
"fastgpt": "v4.15.0-beta1",
"fastgpt-code-sandbox": "v4.15.0-beta1",
"fastgpt-mcp_server": "v4.15.0-beta1",
"fastgpt-plugin": "v0.6.2",
"fastgpt": "v4.15.0",
"fastgpt-code-sandbox": "v4.15.0",
"fastgpt-plugin": "v1.0.0",
"volume-manager": "v0.2.0",
"agent-sandbox-image": "v0.2.0",
"aiproxy": "v0.5.8",
"aiproxy": "v0.6.5",
"fastgpt-mcp_server": "v4.14.23",
"opensandbox-server": "v0.1.9",
"opensandbox-execd": "v1.0.7",
......
......@@ -44,11 +44,10 @@ x-no-proxy-config: &x-no-proxy-config
# 向量库相关配置
x-vec-config: &x-vec-config
${{vec.config}}
# ${{vec.config}}
services:
# Vector DB
${{vec.db}}
# ${{vec.db}}
fastgpt-mongo:
image: ${{mongo.image}}:${{mongo.tag}} # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
......@@ -232,11 +231,6 @@ ${{vec.db}}
networks:
- codesandbox
restart: always
read_only: true
tmpfs:
- /tmp:size=128m,noexec,nosuid,nodev
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
......
......@@ -2,7 +2,7 @@
"tags": {
"fastgpt": "v4.14.26",
"fastgpt-code-sandbox": "v4.14.22",
"fastgpt-mcp_server": "v4.14.22",
"fastgpt-mcp_server": "v4.14.23",
"fastgpt-plugin": "v0.6.2",
"volume-manager": "v0.1.2",
"agent-sandbox-image": "v0.1.2",
......
......@@ -46,11 +46,10 @@ x-no-proxy-config: &x-no-proxy-config
# 向量库相关配置
x-vec-config: &x-vec-config
${{vec.config}}
# ${{vec.config}}
services:
# Vector DB
${{vec.db}}
# ${{vec.db}}
fastgpt-mongo:
image: ${{mongo.image}}:${{mongo.tag}} # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
......
{
"tags": {
"fastgpt": "v4.15.0",
"fastgpt-code-sandbox": "v4.15.0",
"fastgpt-plugin": "v1.0.0",
"volume-manager": "v0.2.0",
"agent-sandbox-image": "v0.2.0",
"agent-sandbox-proxy": "v0.2.0",
"aiproxy": "v0.6.5",
"fastgpt-mcp_server": "v4.14.23",
"aiproxy-pg": "0.8.0-pg15",
"mongo": "5.0.32",
"redis": "7.2-alpine",
"minio": "RELEASE.2025-09-07T16-13-09Z",
"pg": "0.8.0-pg15",
"milvus-minio": "RELEASE.2023-03-20T20-16-18Z",
"milvus-etcd": "v3.5.5",
"milvus-standalone": "v2.4.3",
"oceanbase": "4.3.5-lts",
"seekdb": "1.0.1.0-100000392025122619"
},
"images": {
"cn": {
"fastgpt": "registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt",
"fastgpt-plugin": "registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin",
"fastgpt-code-sandbox": "registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox",
"fastgpt-mcp_server": "registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server",
"volume-manager": "registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager",
"agent-sandbox-image": "registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox",
"agent-sandbox-proxy": "registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy",
"opensandbox-server": "registry.cn-hangzhou.aliyuncs.com/fastgpt/opensandbox-server",
"opensandbox-execd": "registry.cn-hangzhou.aliyuncs.com/fastgpt/opensandbox-execd",
"opensandbox-egress": "registry.cn-hangzhou.aliyuncs.com/fastgpt/opensandbox-egress",
"aiproxy": "registry.cn-hangzhou.aliyuncs.com/labring/aiproxy",
"aiproxy-pg": "registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector",
"mongo": "registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo",
"redis": "registry.cn-hangzhou.aliyuncs.com/fastgpt/redis",
"minio": "registry.cn-hangzhou.aliyuncs.com/fastgpt/minio",
"pg": "registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector",
"milvus-minio": "minio/minio",
"milvus-etcd": "quay.io/coreos/etcd",
"milvus-standalone": "milvusdb/milvus",
"oceanbase": "oceanbase/oceanbase-ce",
"seekdb": "oceanbase/seekdb"
},
"global": {
"fastgpt": "ghcr.io/labring/fastgpt",
"fastgpt-plugin": "ghcr.io/labring/fastgpt-plugin",
"fastgpt-code-sandbox": "ghcr.io/labring/fastgpt-code-sandbox",
"fastgpt-mcp_server": "ghcr.io/labring/fastgpt-mcp_server",
"volume-manager": "ghcr.io/labring/fastgpt-agent-volume-manager",
"agent-sandbox-image": "ghcr.io/labring/fastgpt-agent-sandbox",
"agent-sandbox-proxy": "ghcr.io/labring/fastgpt-agent-sandbox-proxy",
"opensandbox-server": "opensandbox/server",
"opensandbox-execd": "opensandbox/execd",
"opensandbox-egress": "opensandbox/egress",
"aiproxy": "ghcr.io/labring/aiproxy",
"aiproxy-pg": "pgvector/pgvector",
"mongo": "mongo",
"redis": "redis",
"minio": "minio/minio",
"pg": "pgvector/pgvector",
"milvus-minio": "minio/minio",
"milvus-etcd": "quay.io/coreos/etcd",
"milvus-standalone": "milvusdb/milvus",
"oceanbase": "oceanbase/oceanbase-ce",
"seekdb": "oceanbase/seekdb"
}
}
}
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw "1234"
# 系统最高密钥凭证
x-system-key: &x-system-key "fastgpt-xxx"
# 用户登录 JWT 密钥
x-token-key: &x-token-key "fastgpt"
# 文件阅读 token 密钥
x-file-token-key: &x-file-token-key "filetokenkey"
# 密钥加密 key
x-aes256-secret-key: &x-aes256-secret-key "fastgptsecret"
# Invoke 反向调用 JWT 密钥,至少 32 位
x-invoke-token-secret: &x-invoke-token-secret "fastgpt_invoke_token_secret_32_chars_min"
# plugin auth token,v4.15 plugin 服务要求至少 32 位
x-plugin-auth-token: &x-plugin-auth-token "fastgpt-plugin-token-please-change"
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token "codesandbox"
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token "vmtoken"
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"
# aiproxy token
x-aiproxy-token: &x-aiproxy-token "token"
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@fastgpt-redis:6379
# @see https://doc.fastgpt.cn/self-host/config/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_CDN_ENDPOINT:
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATH:
# Log 配置
x-log-config: &x-log-config
LOG_ENABLE_CONSOLE: true
LOG_CONSOLE_LEVEL: debug
LOG_ENABLE_OTEL: false
LOG_OTEL_LEVEL: info
LOG_OTEL_URL: http://localhost:4318/v1/logs
LOG_OTEL_SERVICE_NAME: fastgpt-client
METRICS_ENABLE_OTEL: false
METRICS_OTEL_URL: http://localhost:4318/v1/metrics
METRICS_OTEL_SERVICE_NAME: fastgpt-client
TRACING_ENABLE_OTEL: false
TRACING_OTEL_URL: http://localhost:4318/v1/traces
TRACING_OTEL_SERVICE_NAME: fastgpt-client
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的服务地址配置
x-fastgpt-service-config: &x-fastgpt-service-config
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
CODE_SANDBOX_URL: http://fastgpt-code-sandbox:3000
CODE_SANDBOX_TOKEN: *x-code-sandbox-token
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
AIPROXY_API_TOKEN: *x-aiproxy-token
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的地址。启用 Agent/Skill 沙盒时,必须改成单独部署的 proxy 的 ws:// 或 wss:// 地址。
AGENT_SANDBOX_PROXY_URL:
AGENT_SANDBOX_OPENSANDBOX_BASEURL:
AGENT_SANDBOX_OPENSANDBOX_API_KEY:
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO: ${{agent-sandbox-image.image}}
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG: ${{agent-sandbox-image.tag}}
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE: ${{agent-sandbox-image.image}}:${{agent-sandbox-image.tag}}
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
DEFAULT_ROOT_PSW: *x-default-root-psw
SYSTEM_NAME: FastGPT
SYSTEM_DESCRIPTION:
SYSTEM_FAVICON:
SSE_MCP_SERVER_PROXY_ENDPOINT:
MARKETPLACE_URL: https://v2.marketplace.fastgpt.cn
PASSWORD_EXPIRED_MONTH:
SHOW_COUPON: false
SHOW_DISCOUNT_COUPON: false
HIDE_CHAT_COPYRIGHT_SETTING:
CHINESE_IP_REDIRECT_URL:
PAY_FORM_URL:
AGENT_SANDBOX_FREE_TIP: false
OPENAPI_KEY_MAX_COUNT: 100
# FastGPT 与 Pro 共用环境变量(packages/service/env.ts · serviceEnv)
x-service-env-config: &x-service-env-config
HOSTNAME: 0.0.0.0
NEXT_PUBLIC_BASE_URL:
ROOT_KEY: *x-system-key
DB_MAX_LINK: 5
SYNC_INDEX: true
TOKEN_KEY: *x-token-key
FILE_TOKEN_KEY: *x-file-token-key
AES256_SECRET_KEY: *x-aes256-secret-key
INVOKE_TOKEN_SECRET: *x-invoke-token-secret
MULTIPLE_DATA_TO_BASE64: true
USE_IP_LIMIT: false
CHECK_INTERNAL_IP: false
TRUSTED_PROXY_ENABLE: false
TRUSTED_PROXY_IPS:
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
HELPER_BOT_MODEL: qwen-max
CHAT_TITLE_MODEL:
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 10
PARSE_FILE_TIMEOUT_SECONDS: 600
HTML_TO_MARKDOWN_WORKERS: 10
TEXT_TO_CHUNKS_WORKERS: 10
WORKFLOW_MAX_RUN_TIMES: 500
WORKFLOW_MAX_LOOP_TIMES: 100
WORKFLOW_PARALLEL_MAX_CONCURRENCY: 10
CHAT_MAX_QPM: 5000
SYSTEM_MAX_STRING_LENGTH_M: 100
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
MAX_FOLDER_DEPTH: 4
APP_FOLDER_MAX_AMOUNT: 1000
DATASET_FOLDER_MAX_AMOUNT: 1000
UPLOAD_FILE_MAX_SIZE: 1000
UPLOAD_FILE_MAX_AMOUNT: 1000
LLM_REQUEST_TRACKING_RETENTION_HOURS: 6
MAX_HTML_TRANSFORM_CHARS: 1000000
DATASET_PARSE_MAX_PROCESS: 10
VECTOR_MAX_PROCESS: 10
QA_MAX_PROCESS: 10
VLM_MAX_PROCESS: 10
HNSW_EF_SEARCH: 100
HNSW_MAX_SCAN_TUPLES: 100000
CUSTOM_PDF_PARSE_URL:
CUSTOM_PDF_PARSE_KEY:
DOC2X_KEY:
TEXTIN_APP_ID:
TEXTIN_SECRET_CODE:
CUSTOM_PDF_PARSE_PRICE: 0
FILE_URL_WHITELIST:
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
# ${{vec.config}}
services:
# ${{vec.db}}
fastgpt-mongo:
image: ${{mongo.image}}:${{mongo.tag}} # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
restart: always
networks:
- data
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- fastgpt-mongo:/data/db
healthcheck:
test:
[
"CMD",
"mongo",
"-u",
"myusername",
"-p",
"mypassword",
"--authenticationDatabase",
"admin",
"--eval",
"db.adminCommand('ping')",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "fastgpt-mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
fastgpt-redis:
image: ${{redis.image}}:${{redis.tag}}
container_name: fastgpt-redis
networks:
- data
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ["CMD", "redis-cli", "-a", "mypassword", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- fastgpt-redis:/data
fastgpt-minio:
image: ${{minio.image}}:${{minio.tag}}
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- data
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
fastgpt-app:
container_name: fastgpt-app
image: ${{fastgpt.image}}:${{fastgpt.tag}}
ports:
- 3000:3000
networks:
- data
- app
- codesandbox
- aiproxy
depends_on:
fastgpt-mongo:
condition: service_healthy
# ${{vec.depends}}
fastgpt-redis:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
fastgpt-code-sandbox:
condition: service_healthy
fastgpt-plugin:
condition: service_healthy
restart: always
environment:
# 完整变量请参考: https://github.com/labring/FastGPT/blob/main/projects/app/.env.template
<<:
[
*x-share-db-config,
*x-vec-config,
*x-log-config,
*x-no-proxy-config,
*x-fastgpt-service-config,
*x-agent-sandbox-config,
*x-service-env-config,
*x-app-env-config,
]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ${{fastgpt-code-sandbox.image}}:${{fastgpt-code-sandbox.tag}}
networks:
- codesandbox
restart: always
security_opt:
- no-new-privileges:true
environment:
<<: [*x-log-config, *x-no-proxy-config]
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
SANDBOX_TOKEN: *x-code-sandbox-token
# ===== Resource Limits =====
# Maximum API JSON body size (MB), including variables
SANDBOX_API_MAX_BODY_MB: 8
# Execution timeout per request (ms)
SANDBOX_MAX_TIMEOUT: 60000
# Maximum allowed memory per user code execution (MB)
# Note: System automatically adds 50MB for runtime overhead
# Actual process limit = SANDBOX_MAX_MEMORY_MB + 50MB
SANDBOX_MAX_MEMORY_MB: 256
SANDBOX_MAX_OUTPUT_MB: 10
# Number of requests with the same queueId that may enter execution concurrently. Empty disables queueing.
SANDBOX_QUEUE_ID_CONCURRENCY:
# ===== Process Pool =====
# Number of pre-warmed worker processes (JS + Python)
SANDBOX_POOL_SIZE: 20
# ===== Network Request Limits =====
# Whether to check if the request is to a private network
CHECK_INTERNAL_IP: true
# Maximum number of HTTP requests per execution
SANDBOX_REQUEST_MAX_COUNT: 30
# Timeout for each outbound HTTP request (ms)
SANDBOX_REQUEST_TIMEOUT: 60000
# Maximum response body size for outbound requests
SANDBOX_REQUEST_MAX_RESPONSE_MB: 10
# Maximum request body size for outbound requests (MB)
SANDBOX_REQUEST_MAX_BODY_MB: 5
# ===== Module Control =====
# JS allowed modules whitelist (comma-separated)
SANDBOX_JS_ALLOWED_MODULES: lodash,dayjs,moment,uuid,crypto-js,qs,url,querystring
# Python allowed modules whitelist (comma-separated)
SANDBOX_PYTHON_ALLOWED_MODULES: math,cmath,decimal,fractions,random,statistics,collections,array,heapq,bisect,queue,copy,itertools,functools,operator,string,re,difflib,textwrap,unicodedata,codecs,datetime,time,calendar,_strptime,json,csv,base64,binascii,struct,hashlib,hmac,secrets,uuid,typing,abc,enum,dataclasses,contextlib,pprint,weakref,numpy,pandas,matplotlib
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) throw new Error(String(res.status)); })",
]
interval: 30s
timeout: 20s
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ${{fastgpt-mcp_server.image}}:${{fastgpt-mcp_server.tag}}
networks:
- app
ports:
- 3003:3000
restart: always
environment:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ${{fastgpt-plugin.image}}:${{fastgpt-plugin.tag}}
container_name: fastgpt-plugin
restart: always
networks:
- data
- app
environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
# v4.15 plugin 服务使用独立数据库,避免和 FastGPT 主库集合冲突。
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
# 传递给 OTLP 收集器的服务名称
LOG_OTEL_SERVICE_NAME: fastgpt-plugin
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 20s
retries: 3
# AI Proxy
fastgpt-aiproxy:
image: ${{aiproxy.image}}:${{aiproxy.tag}}
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
fastgpt-aiproxy-pg:
condition: service_healthy
networks:
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@fastgpt-aiproxy-pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
DISABLE_MODEL_CONFIG: true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
interval: 5s
timeout: 5s
retries: 10
fastgpt-aiproxy-pg:
image: ${{aiproxy-pg.image}}:${{aiproxy-pg.tag}} # docker hub
restart: unless-stopped
container_name: fastgpt-aiproxy-pg
volumes:
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
environment:
TZ: Asia/Shanghai
POSTGRES_USER: postgres
POSTGRES_DB: aiproxy
POSTGRES_PASSWORD: aiproxy
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
interval: 5s
timeout: 5s
retries: 10
networks:
data:
name: fastgpt_data
vector:
name: fastgpt_vector
app:
name: fastgpt_app
codesandbox:
name: fastgpt_codesandbox
aiproxy:
name: fastgpt_aiproxy
volumes:
fastgpt-pg:
fastgpt-mongo:
fastgpt-redis:
fastgpt-minio:
fastgpt-milvus-minio:
fastgpt-milvus-etcd:
fastgpt-milvus-data:
fastgpt-ob-data:
fastgpt-ob-config:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
# ${{vec.extraBlock}}
---
title: Configuration File Guide
description: FastGPT configuration parameters explained
---
Since environment variables aren't ideal for complex configurations, newer versions of FastGPT use ConfigMap-style mounted configuration files. You can find the default config at `projects/app/data/config.json`. See the [Docker Compose deployment guide](../deploy/docker.en.mdx) for how to mount the config file.
**In development**, copy the example config `config.json` to `config.local.json` for it to take effect.
The example below includes system parameters and model configurations:
## Config File Example (v4.8.20+)
> Starting from v4.8.20, models are configured through the UI.
```json
{
"feConfigs": {},
"systemEnv": {
"vectorMaxProcess": 15, // Vector processing thread count
"qaMaxProcess": 15, // Q&A splitting thread count
"vlmMaxProcess": 15, // Vision-language model max processing threads
"hnswEfSearch": 100, // Vector search parameter (PG and OB only). Higher = more accurate but slower. 100 gives 99%+ accuracy.
"customPdfParse": {
// Added in v4.9.0
"url": "", // Custom PDF parsing service URL
"key": "", // Custom PDF parsing service key
"doc2xKey": "", // Doc2x service key
"price": 0 // PDF parsing service price
}
}
}
```
## Custom PDF Parsing Configuration
Custom PDF parsing takes priority over Doc2x. If you're using Doc2x, don't configure a custom PDF service.
### Using Sealos PDF Parsing Service
#### 1. Get a Sealos AI Proxy API Key
[Open Sealos PDF Parser](https://hzh.sealos.run/?uid=fnWRt09fZP&openapp=system-aiproxy) and apply for an API key.
#### 2. Update FastGPT Configuration
Set `systemEnv.customPdfParse.url` to `https://aiproxy.hzh.sealos.run/v1/parse/pdf?model=parse-pdf`
Set `systemEnv.customPdfParse.key` to the API key from Sealos AI Proxy.
### Using Doc2x for PDF Parsing
`Doc2x` is a professional PDF parsing service.
#### 1. Sign Up for Doc2x
[Open Doc2x website](https://doc2x.noedgeai.com?inviteCode=9EACN2) and apply for an API key.
#### 2. Update FastGPT Configuration
Community Edition users: add `systemEnv.customPdfParse.doc2xKey` to your `config.json` with the API key, then restart the service.
Commercial Edition users: fill in the Doc2x service key in the Admin dashboard following the form instructions.
#### 3. Start Using It
When importing data to your knowledge base or configuring file uploads in your app, check `Enhanced PDF Parsing`. PDFs will then be parsed using the Doc2x service.
### Using Marker for PDF Parsing
[View the Marker integration tutorial](../custom-models/marker.en.mdx)
---
title: config.json 文件配置
description: FastGPT config.json 文件配置
---
**该配置仅适用于社区版,商业版用户该配置已集成至后台。**
由于环境变量不利于配置复杂的内容,新版 FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在 `projects/app/data/config.json` 看到默认的配置文件。可以参考 [docker-compose 快速部署](../deploy/docker.mdx) 来挂载配置文件。
**开发环境下**,你需要将示例配置文件 `config.json` 复制成 `config.local.json` 文件才会生效。
下面配置文件示例中包含了系统参数和各个模型配置:
## 4.8.20+ 版本新配置文件示例
> 从 4.8.20 版本开始,模型在页面中进行配置。
```json
{
"feConfigs": {},
"systemEnv": {
"vectorMaxProcess": 15, // 向量处理线程数量
"qaMaxProcess": 15, // 问答拆分线程数量
"vlmMaxProcess": 15, // 图片理解模型最大处理进程
"hnswEfSearch": 100, // 向量搜索参数,仅对 PG 和 OB 生效。越大,搜索越精确,但是速度越慢。设置为100,有99%+精度。
"customPdfParse": {
// 4.9.0 新增配置
"url": "", // 自定义 PDF 解析服务地址
"key": "", // 自定义 PDF 解析服务密钥
"doc2xKey": "", // doc2x 服务密钥
"price": 0 // PDF 解析服务价格
}
}
}
```
## 自定义 PDF 解析配置
自定义 PDF 服务解析的优先级高于 Doc2x 服务,所以如果使用 Doc2x 服务,请勿配置自定义 PDF 服务。
### 使用 Sealos PDF 解析服务
#### 1. 申请 Sealos AI proxy API Key
[点击打开 Sealos PDF parser 官网](https://hzh.sealos.run/?uid=fnWRt09fZP&openapp=system-aiproxy),并进行对应 API Key 的申请。
#### 2. 修改 FastGPT 配置文件
`systemEnv.customPdfParse.url` 填写成 `https://aiproxy.hzh.sealos.run/v1/parse/pdf?model=parse-pdf`
`systemEnv.customPdfParse.key` 填写成在 Sealos AI proxy 中申请的 API Key。
### 使用 Doc2x 解析 PDF 文件
`Doc2x` 是一个国内提供专业 PDF 解析。
#### 1. 申请 Doc2x 服务
[点击打开 Doc2x 官网](https://doc2x.noedgeai.com?inviteCode=9EACN2),并进行对应 API Key 的申请。
#### 2. 修改 FastGPT 配置文件
社区版用户在 `config.json` 文件中添加 `systemEnv.customPdfParse.doc2xKey` 配置,并填写上申请到的 API Key。并重启服务。
商业版用户在 Admin 后台根据表单指引填写 Doc2x 服务密钥。
#### 3. 开始使用
在知识库导入数据或应用文件上传配置中,可以勾选 `PDF 增强解析`,则在对 PDF 解析时候,会使用 Doc2x 服务进行解析。
### 使用 Marker 解析 PDF 文件
[点击查看 Marker 接入教程](../custom-models/marker.mdx)
{
"title": "Configuration",
"description": "FastGPT self-hosting configuration",
"pages": ["model", "sandbox", "object-storage", "json", "env", "signoz", "remote-debug-suite"]
"pages": ["model", "sandbox", "object-storage", "env", "signoz", "remote-debug-suite"]
}
{
"title": "配置说明",
"description": "FastGPT 自部署配置",
"pages": ["model", "sandbox", "object-storage", "json", "env", "signoz", "remote-debug-suite"]
"pages": ["model", "sandbox", "object-storage", "env", "signoz", "remote-debug-suite"]
}
......@@ -3,114 +3,77 @@ title: General Sandbox Configuration
description: General FastGPT Agent Sandbox configuration
---
This page covers the shared Agent Sandbox configuration for both `opensandbox` and `sealosdevbox` . Provider-specific connection settings are documented in each provider page. Regardless of the provider, you need to deploy `fastgpt-agent-sandbox-proxy` and optionally configure package mirrors for the sandbox runtime.
This page covers shared Agent Sandbox configuration for both `opensandbox` and `sealosdevbox`. Provider-specific settings are documented on each provider page. Regardless of the provider, you need to deploy `fastgpt-agent-sandbox-proxy` and optionally configure package mirrors for the sandbox runtime.
## Base Environment Variables
## Deploy sandbox-proxy
Add the following environment variables to both `fastgpt-app` and `fastgpt-pro` :
### 1. Add the yml service
Use [agent-sandbox-proxy.yml](/deploy/docker/v4.15/agent-proxy.yml) as a reference and add the service to your yml file. Expose the external access port and record the `AGENT_SANDBOX_PROXY_SECRET` value, which you will need in the next step.
FastGPT uses this proxy when accessing the sandbox file system.
**Proxy service environment variables**
| Variable | Default | Description |
| ---------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `PORT` | `1006` | Listening port for `fastgpt-agent-sandbox-proxy`. |
| `AGENT_SANDBOX_PROXY_SECRET` | None | Secret shared with the FastGPT main service. Must be at least 32 characters. |
| `FASTGPT_APP_URL` | `http://fastgpt-app:3000` | Internal URL of the FastGPT main service. The proxy and FastGPT must be able to reach each other on the network. |
| `FASTGPT_APP_REQUEST_TIMEOUT_SECS` | `10` | Timeout, in seconds, for proxy requests back to the FastGPT main service. Increase it if sandbox cold starts take longer. |
| `RUST_LOG` | `info,fastgpt_agent_sandbox_proxy=debug` | Log level for the proxy service. |
### 2. Update FastGPT environment variables
Add the following environment variables to both `fastgpt-app` and `fastgpt-pro`:
```dotenv
# Shared with fastgpt-agent-sandbox-proxy. Use a random secret longer than 32 characters in production.
# Must match AGENT_SANDBOX_PROXY_SECRET in fastgpt-agent-sandbox-proxy. Use a random secret longer than 32 characters in production.
AGENT_SANDBOX_PROXY_SECRET=replace_with_32_chars_random_secret
# Browser-accessible WebSocket URL for agent-sandbox-proxy. Use wss:// when proxying through an HTTPS domain.
AGENT_SANDBOX_PROXY_URL=wss://sandbox-proxy.example.com
```
| Variable | Description |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `AGENT_SANDBOX_PROXY_SECRET` | Shared HMAC secret for the main service and `fastgpt-agent-sandbox-proxy` . It must be at least 32 characters, and both services must use the exact same value. |
| `AGENT_SANDBOX_PROXY_URL` | Browser-accessible WebSocket base URL for `fastgpt-agent-sandbox-proxy` . It must start with `ws://` or `wss://` . Do not set this to the FastGPT main site URL. |
## Deploy fastgpt-agent-sandbox-proxy
`fastgpt-agent-sandbox-proxy` is the WebSocket proxy between the browser and the sandbox IDE Agent. The browser does not connect to the provider's internal sandbox directly. Instead, it connects to this proxy, which calls back to the FastGPT main service to verify the ticket and then forwards traffic to the target sandbox.
Docker Compose example:
```yml
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
ports:
- 3006:1006
networks:
- app
environment:
PORT: 1006
# Must exactly match AGENT_SANDBOX_PROXY_SECRET in fastgpt-app / fastgpt-pro.
AGENT_SANDBOX_PROXY_SECRET: replace_with_32_chars_random_secret
# Internal FastGPT main service URL. Change the service name if your deployment uses a different one.
FASTGPT_APP_URL: http://fastgpt-app:3000
# Covers sandbox cold start, agent password reads, and endpoint lookup time.
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# Configure this only when the upstream sandbox endpoint returns localhost/127.0.0.1 and the proxy container cannot reach it.
# AGENT_SANDBOX_PROXY_REWRITE_HOST: host.docker.internal
```
### 3. Verify startup
For China Mainland deployments, you can use this image instead:
1. Restart `fastgpt-app`, `fastgpt-pro`, and `fastgpt-agent-sandbox-proxy`.
2. Visit `https://agent-proxy-domain/health`. It should return `OK`.
```yml
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.2.0
```
### 4. Deploy a sandbox provider
When deploying the proxy on Sealos, create a new app, use the matching `fastgpt-agent-sandbox-proxy` image, expose container port `1006` , and configure the environment variables above. The public access URL must support WebSocket Upgrade. Then set `AGENT_SANDBOX_PROXY_URL` in both `fastgpt-app` and `fastgpt-pro` to that public URL using `ws://` or `wss://` .
After deploying the proxy service, connect one of the supported sandbox providers:
## proxy Environment Variables
- [Sealos Cloud Sandbox](./sealosdevbox)
- [OpenSandbox Deployment](./opensandbox)
| Variable | Default | Description |
| ---------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `PORT` | `1006` | Listening port for `fastgpt-agent-sandbox-proxy` . |
| `AGENT_SANDBOX_PROXY_SECRET` | None | Secret shared with the FastGPT main service. Must be at least 32 characters. |
| `FASTGPT_APP_URL` | `http://localhost:3000` | Internal URL of the FastGPT main service. The proxy uses it to call `/api/core/ai/sandbox/verifyTicket` . |
| `FASTGPT_APP_REQUEST_TIMEOUT_SECS` | `10` | Timeout, in seconds, for proxy requests back to the FastGPT main service. Increase it if sandbox cold starts take longer. |
| `RUST_LOG` | `info,fastgpt_agent_sandbox_proxy=debug` | Log level for the proxy service. |
| `AGENT_SANDBOX_PROXY_REWRITE_HOST` | Empty | Rewrites the upstream host when the provider returns a `localhost` or `127.0.0.1` sandbox endpoint that the proxy cannot reach. |
## Additional Configuration
## Custom Package Mirrors
### Custom package mirrors
If the sandbox needs to install npm or Python dependencies, configure package mirrors in both `fastgpt-app` and `fastgpt-pro` . During Agent Sandbox initialization, FastGPT writes these settings for npm, yarn, pnpm, bun, pip, and uv.
If the sandbox needs to install npm or Python dependencies, configure package mirrors in both `fastgpt-app` and `fastgpt-pro`. During Agent Sandbox initialization, FastGPT writes these settings for npm, yarn, pnpm, bun, pip, and uv.
```dotenv
# npm registry used by npm/yarn/pnpm/bun inside Agent Sandbox
AGENT_SANDBOX_NPM_REGISTRY=https://registry.npmmirror.com
# PyPI index URL used by pip/python -m pip/uv inside Agent Sandbox
AGENT_SANDBOX_PYPI_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
```
| Variable | Description |
| ------------------------------ | ------------------------------------------------------------------------ |
| `AGENT_SANDBOX_NPM_REGISTRY` | npm registry used by npm, yarn, pnpm, and bun inside the sandbox. |
| `AGENT_SANDBOX_PYPI_INDEX_URL` | PyPI index URL used by pip, `python -m pip` , and uv inside the sandbox. |
This configuration is cached by content hash in the sandbox runtime state. For the same sandbox, FastGPT rewrites the mirror settings only when the configuration changes.
## Optional Limit Settings
### Resource limit variables
The following variables usually keep their defaults. Configure them only when you need to change file size limits, WebSocket message limits, or the IDE Agent listening port.
Configure the following variables in `fastgpt-app` and `fastgpt-pro` when you need to adjust resource limits:
| Variable | Default | Description |
| ------------------------------------ | -------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `IDE_AGENT_BIND_ADDR` | `0.0.0.0:1318` | Listening address for the IDE Agent inside the sandbox. Change it only when using a custom sandbox image or port. |
| `AGENT_SANDBOX_DISK_MB` | `1024` | Baseline Agent Sandbox disk size in MB. It affects cold archive package limits, Skill package limits, and IDE single-file size. |
| ------------------------------------ | ---------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `AGENT_SANDBOX_DISK_MB` | `1024` | Baseline Agent Sandbox disk size in MB. It affects cold archive package limits, Skill package limits, and IDE single-file limits. |
| `AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES` | `67108864` | Maximum IDE Agent WebSocket message size in bytes. |
| `AGENT_SANDBOX_WS_MAX_FRAME_BYTES` | `16777216` | Maximum IDE Agent WebSocket frame size in bytes. |
## Verification
1. Restart `fastgpt-app` , `fastgpt-pro` , and `fastgpt-agent-sandbox-proxy` .
2. Visit `https://your-proxy-domain/health` . It should return `OK` .
3. In FastGPT, open a scenario that supports Agent Sandbox, such as sandbox file editing or terminal access.
4. If you can read files, write files, or open the terminal, the shared configuration is working.
## FAQ
### AGENT_SANDBOX_PROXY_URL is required
After Agent Sandbox is enabled, `AGENT_SANDBOX_PROXY_URL` is required. This is the browser-accessible WebSocket URL for `fastgpt-agent-sandbox-proxy` , such as `wss://sandbox-proxy.example.com` . It is not the FastGPT main site URL.
After Agent Sandbox is enabled, `AGENT_SANDBOX_PROXY_URL` is required. This is the browser-accessible WebSocket URL for `fastgpt-agent-sandbox-proxy`, such as `wss://sandbox-proxy.example.com`. It is not the FastGPT main site URL.
### Browser WebSocket connection fails
......@@ -118,4 +81,4 @@ Check that the proxy service is reachable from the browser and that your reverse
### proxy validation fails or returns 401
Make sure `AGENT_SANDBOX_PROXY_SECRET` is exactly the same in the FastGPT main service and `fastgpt-agent-sandbox-proxy` , and that it is at least 32 characters long.
Make sure `AGENT_SANDBOX_PROXY_SECRET` is exactly the same in the FastGPT main service and `fastgpt-agent-sandbox-proxy`, and that it is at least 32 characters long.
......@@ -5,107 +5,70 @@ description: FastGPT Agent Sandbox 通用配置
本文说明 Agent Sandbox 的通用配置,适用于 `opensandbox` 和 `sealosdevbox`。Provider 自身的接入参数请参考对应 Provider 文档;无论选择哪种 Provider,都需要部署 `fastgpt-agent-sandbox-proxy`,并按需配置沙盒内依赖源。
## 基础环境变量
## 部署 sandbox-proxy
### 1. 添加 yml
可以参考 [agent-sandbox-proxy.yml](/deploy/docker/v4.15/agent-proxy.yml),将 service 加到 yml 文件里。并开放外网访问端口。并记录 `AGENT_SANDBOX_PROXY_SECRET` 环境变量,下一步需要使用。
FastGPT 服务里访问沙盒内部文件系统,会通过 proxy 去代理访问。
**proxy 服务环境变量**
| 变量 | 默认值 | 说明 |
| ---------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------- |
| `PORT` | `1006` | `fastgpt-agent-sandbox-proxy` 监听端口。 |
| `AGENT_SANDBOX_PROXY_SECRET` | 无 | 与 FastGPT 主服务共用的密钥,至少 32 位。 |
| `FASTGPT_APP_URL` | `http://fastgpt-app:3000` | 代理回源 FastGPT 主服务的内网地址,要求两个服务在一个互通网络。 |
| `FASTGPT_APP_REQUEST_TIMEOUT_SECS` | `10` | 代理回源 FastGPT 主服务的请求超时时间,单位秒。沙盒冷启动较慢时建议调大。 |
| `RUST_LOG` | `info,fastgpt_agent_sandbox_proxy=debug` | 代理服务日志级别。 |
### 2. 修改 FastGPT 环境变量
在 `fastgpt-app` 和 `fastgpt-pro` 中增加下面环境变量:
```dotenv
# 与 fastgpt-agent-sandbox-proxy 共用,生产环境请改为 32 位以上随机密钥
# 对应 fastgpt-agent-sandbox-proxy 的变量 AGENT_SANDBOX_PROXY_SECRET。生产环境请改为 32 位以上随机密钥
AGENT_SANDBOX_PROXY_SECRET=replace_with_32_chars_random_secret
# 浏览器可访问的 agent-sandbox-proxy WebSocket 地址;如已通过 HTTPS 域名代理,请使用 wss://
AGENT_SANDBOX_PROXY_URL=wss://sandbox-proxy.example.com
```
| 变量 | 说明 |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `AGENT_SANDBOX_PROXY_SECRET` | 主服务与 `fastgpt-agent-sandbox-proxy` 共用的 HMAC 密钥,至少 32 位。两个服务必须配置完全相同的值。 |
| `AGENT_SANDBOX_PROXY_URL` | 浏览器访问 `fastgpt-agent-sandbox-proxy` 的 WebSocket 基础地址,必须以 `ws://` 或 `wss://` 开头。该地址不是 FastGPT 主站地址。 |
## 部署 fastgpt-agent-sandbox-proxy
`fastgpt-agent-sandbox-proxy` 是浏览器到沙盒 IDE Agent 的 WebSocket 代理。浏览器不会直接连接 Provider 内部沙盒,而是先连接这个代理,再由代理回源 FastGPT 主服务校验 ticket,并转发到对应沙盒。
Docker Compose 示例:
```yml
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
ports:
- 3006:1006
networks:
- app
environment:
PORT: 1006
# 必须与 fastgpt-app / fastgpt-pro 中的 AGENT_SANDBOX_PROXY_SECRET 完全一致
AGENT_SANDBOX_PROXY_SECRET: replace_with_32_chars_random_secret
# FastGPT 主服务内网地址;如果服务名不是 fastgpt-app,请按实际部署修改
FASTGPT_APP_URL: http://fastgpt-app:3000
# 覆盖沙盒冷启动、读取 agent password 和 endpoint 查询耗时
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# 当上游 sandbox endpoint 返回 localhost/127.0.0.1 且 proxy 容器无法访问时再配置
# AGENT_SANDBOX_PROXY_REWRITE_HOST: host.docker.internal
```
### 3. 启动验证
国内镜像源可替换为:
1. 重启 `fastgpt-app`、`fastgpt-pro` 和 `fastgpt-agent-sandbox-proxy`。
2. 访问 `https://agent-proxy域名/health`,正常返回 `OK`。
```yml
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.2.0
```
### 4. 部署沙盒服务
如果使用 Sealos 部署代理服务,需要创建一个新的应用,镜像填写 `fastgpt-agent-sandbox-proxy` 对应镜像,容器端口为 `1006`,并配置上面环境变量。外网访问地址需要支持 WebSocket Upgrade,然后把 `fastgpt-app` 和 `fastgpt-pro` 的 `AGENT_SANDBOX_PROXY_URL` 设置为该外网访问地址的 `ws://` 或 `wss://` 形式。
部署完 proxy 服务后,还需接入沙盒控制服务,目前系统支持以下两种方案:
## proxy 环境变量
- [Sealos cloud 沙盒接入](./sealosdevbox)
- [Opensandbox 部署方案](./opensandbox)
| 变量 | 默认值 | 说明 |
| ---------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `PORT` | `1006` | `fastgpt-agent-sandbox-proxy` 监听端口。 |
| `AGENT_SANDBOX_PROXY_SECRET` | 无 | 与 FastGPT 主服务共用的密钥,至少 32 位。 |
| `FASTGPT_APP_URL` | `http://localhost:3000` | 代理回源 FastGPT 主服务的内网地址,用于调用 `/api/core/ai/sandbox/verifyTicket`。 |
| `FASTGPT_APP_REQUEST_TIMEOUT_SECS` | `10` | 代理回源 FastGPT 主服务的请求超时时间,单位秒。沙盒冷启动较慢时建议调大。 |
| `RUST_LOG` | `info,fastgpt_agent_sandbox_proxy=debug` | 代理服务日志级别。 |
| `AGENT_SANDBOX_PROXY_REWRITE_HOST` | 空 | 当 Provider 返回的沙盒 endpoint 是 `localhost` 或 `127.0.0.1`,且代理容器无法访问时,用该变量改写上游 Host。 |
## 更多配置
## 自定义依赖源
### 自定义源
如果沙盒内需要安装 npm 或 Python 依赖,可以在 `fastgpt-app` 和 `fastgpt-pro` 中配置依赖源。配置后,Agent Sandbox 初始化时会写入 npm、yarn、pnpm、bun、pip 和 uv 的源配置。
```dotenv
# Agent Sandbox 内 npm/yarn/pnpm/bun 使用的 npm registry
AGENT_SANDBOX_NPM_REGISTRY=https://registry.npmmirror.com
# Agent Sandbox 内 pip/python -m pip/uv 使用的 PyPI index URL
AGENT_SANDBOX_PYPI_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
```
| 变量 | 说明 |
| ------------------------------ | ------------------------------------------------------- |
| `AGENT_SANDBOX_NPM_REGISTRY` | 沙盒内 npm、yarn、pnpm、bun 使用的 npm registry。 |
| `AGENT_SANDBOX_PYPI_INDEX_URL` | 沙盒内 pip、`python -m pip`、uv 使用的 PyPI index URL。 |
该配置会按内容 hash 缓存在 sandbox runtime state 中,同一个 sandbox 仅在配置变化时重新写入。
## 可选限制配置
### 资源限制变量
下面变量通常保持默认即可,仅在需要调整文件大小、WebSocket 消息大小或 IDE Agent 监听端口时配置:
`fastpgt-app` 和 `fastgpt-pro` 中你可以通过以下变量控制资源限制:
| 变量 | 默认值 | 说明 |
| ------------------------------------ | -------------- | -------------------------------------------------------------------------------- |
| `IDE_AGENT_BIND_ADDR` | `0.0.0.0:1318` | 沙盒内 IDE Agent 监听地址。只有自定义沙盒镜像或端口时才需要调整。 |
| ------------------------------------ | ---------- | -------------------------------------------------------------------------------- |
| `AGENT_SANDBOX_DISK_MB` | `1024` | Agent 沙盒磁盘大小基准,单位 MB;会影响冷归档包、Skill 包和 IDE 单文件大小限制。 |
| `AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES` | `67108864` | IDE Agent WebSocket 单消息大小上限,单位字节。 |
| `AGENT_SANDBOX_WS_MAX_FRAME_BYTES` | `16777216` | IDE Agent WebSocket 单帧大小上限,单位字节。 |
## 验证
1. 重启 `fastgpt-app`、`fastgpt-pro` 和 `fastgpt-agent-sandbox-proxy`。
2. 访问 `https://你的代理域名/health`,正常返回 `OK`。
3. 在 FastGPT 中进入支持 Agent Sandbox 的调试或对话场景,打开沙盒文件编辑器或终端。
4. 如果能正常读取文件、写入文件或打开终端,说明通用配置生效。
## 常见问题
### 提示 AGENT_SANDBOX_PROXY_URL is required
......
{
"title": "Sandbox Configuration",
"description": "FastGPT Agent Sandbox deployment configuration",
"pages": ["common", "sealosdevbox"]
"pages": ["common", "sealosdevbox", "opensandbox"]
}
{
"title": "沙盒配置",
"description": "FastGPT Agent Sandbox 部署配置",
"pages": ["common", "sealosdevbox"]
"pages": ["common", "sealosdevbox", "opensandbox"]
}
---
title: OpenSandbox Deployment
description: Use self-hosted OpenSandbox with FastGPT Agent Sandbox
---
OpenSandbox is suitable when you want to self-host the Agent/Skill sandbox runtime. Before starting, complete [General Sandbox Configuration](./common), make sure `fastgpt-agent-sandbox-proxy` is deployed, and configure the same `AGENT_SANDBOX_PROXY_SECRET` and browser-accessible `AGENT_SANDBOX_PROXY_URL` in both `fastgpt-app` and `fastgpt-pro`.
The OpenSandbox setup flow is below.
## 1. Add yml services
Use [opensandbox.yml](/deploy/docker/v4.15/opensandbox.yml) as a reference. Add `fastgpt-opensandbox-server`, `fastgpt-volume-manager`, the image pre-pull services, and `opensandbox-config` to your current FastGPT `docker-compose.yml`. Place them on the same `app` network as the FastGPT App service. You do not need to expose OpenSandbox or Volume Manager ports publicly. Deploy Agent Sandbox Proxy separately as described in [General Sandbox Configuration](./common).
The sample uses China Mainland image registries. For deployments outside China Mainland, replace them with:
- `opensandbox/server:v0.1.9`
- `ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0`
- `opensandbox/execd:v1.0.6`
- `opensandbox/egress:v1.0.1`
- `ghcr.io/labring/fastgpt-agent-volume-manager:v0.2.0`
## 2. Update OpenSandbox variables
Only the following values usually need to be changed:
| Setting | Description |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `x-volume-manager-auth-token` | Authentication token for `fastgpt-volume-manager`. It must match `AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN` in FastGPT. |
| `[server].api_key` | OpenSandbox Server API key. It must match `AGENT_SANDBOX_OPENSANDBOX_API_KEY` in FastGPT. |
Docker runtime requires mounting the host Docker socket. The default Docker path is usually `/var/run/docker.sock`; environments such as OrbStack may require replacing it with the actual socket path.
If the server has `HTTP_PROXY` / `HTTPS_PROXY` configured, set `NO_PROXY` / `no_proxy` for OpenSandbox Server and Volume Manager. Include at least `localhost,127.0.0.1,127.0.0.0/8,fastgpt-opensandbox-server,fastgpt-volume-manager,host.docker.internal` to prevent internal service calls from being routed through the proxy. OrbStack/Docker may inject IPv6 CIDR entries into `NO_PROXY`; httpx used by OpenSandbox may parse unbracketed IPv6 CIDR values as invalid URL ports. Explicitly override `NO_PROXY` if you hit that startup issue.
## 3. Update FastGPT variables
Add or update the following environment variables in both `fastgpt-app` and `fastgpt-pro`:
```dotenv
# Enable OpenSandbox as the Agent Sandbox provider
AGENT_SANDBOX_PROVIDER=opensandbox
# Internal URL for FastGPT to access OpenSandbox Server
AGENT_SANDBOX_OPENSANDBOX_BASEURL=http://fastgpt-opensandbox-server:8090
# OpenSandbox API key. Must match [server].api_key in opensandbox-config.
AGENT_SANDBOX_OPENSANDBOX_API_KEY=replace_with_opensandbox_api_key
# Docker compose deployments use docker runtime
AGENT_SANDBOX_OPENSANDBOX_RUNTIME=docker
# Runtime image used when OpenSandbox creates Agent Sandbox instances
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO=registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG=v0.2.0
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY=true
# Persistent volume manager URL and token. The token must match x-volume-manager-auth-token.
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL=http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN=replace_with_volume_manager_token
```
If your `docker-compose.yml` already uses `x-agent-sandbox-config` to inject Agent Sandbox variables, fill these values in that anchor so both `fastgpt-app` and `fastgpt-pro` inherit the same configuration.
## 4. Start and verify
1. Pre-pull the sandbox runtime images:
```bash
docker compose --profile prepull pull opensandbox-agent-sandbox-image opensandbox-execd-image opensandbox-egress-image
```
2. Start or restart the related services:
```bash
docker compose up -d fastgpt-opensandbox-server fastgpt-volume-manager fastgpt-app fastgpt-pro
```
3. Check service health inside the container network:
```bash
docker compose exec fastgpt-opensandbox-server python -c "import urllib.request; print(urllib.request.urlopen('http://localhost:8090/health', timeout=5).read().decode())"
docker compose exec fastgpt-volume-manager node -e "fetch('http://localhost:3000/health').then(async r => { console.log(await r.text()); if (!r.ok) process.exit(1); })"
```
OpenSandbox should return `OK`, and `fastgpt-volume-manager` should return a health JSON response. See [General Sandbox Configuration](./common) for Agent Sandbox Proxy verification.
4. Log in to FastGPT and open a scenario that supports Agent Sandbox, such as Agent V2 VM, Skill editing, or Skill debugging. Confirm that the sandbox can be created and that the file tree and terminal open normally.
## FAQ
### Sandbox provider apiKey is required for opensandbox
Check that both `fastgpt-app` and `fastgpt-pro` have `AGENT_SANDBOX_OPENSANDBOX_API_KEY` configured, and make sure it matches `[server].api_key` in `opensandbox-config`.
### AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL is required
OpenSandbox mode requires deploying `fastgpt-volume-manager` and configuring `AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL` and `AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN` in FastGPT.
### The sandbox is created, but the file tree or terminal fails to connect
Check that `AGENT_SANDBOX_PROXY_URL` is a browser-accessible `ws://` or `wss://` URL and that your reverse proxy supports WebSocket Upgrade. If the FastGPT main site uses HTTPS, the proxy URL should use `wss://`.
### proxy cannot connect to the sandbox endpoint
Check `[docker].host_ip` in `opensandbox-config` first. When OpenSandbox Server runs in a container, sandbox endpoints using `localhost` or `127.0.0.1` are not reachable from the proxy container. Use the host's internal IP or `host.docker.internal`.
---
title: OpenSandbox 部署
description: FastGPT 使用 OpenSandbox 自托管 Agent Sandbox
---
OpenSandbox 适合需要自托管 Agent/Skill 沙盒运行环境的场景。开始前,请先完成[沙盒通用配置](./common),确保 `fastgpt-agent-sandbox-proxy` 已部署,并且 `fastgpt-app`、`fastgpt-pro` 已配置相同的 `AGENT_SANDBOX_PROXY_SECRET` 和可被浏览器访问的 `AGENT_SANDBOX_PROXY_URL`。
下面是 OpenSandbox 部署和配置流程。
## 1. 添加 yml service
参考 [opensandbox.yml](/deploy/docker/v4.15/opensandbox.yml),将 `fastgpt-opensandbox-server`、`fastgpt-volume-manager`、预拉取镜像和 `opensandbox-config` 加入当前 FastGPT 部署的 `docker-compose.yml`,并放到 FastGPT App 所在的 `app` network 中;不需要对外暴露 OpenSandbox 或 Volume Manager 端口。Agent Sandbox Proxy 请按[沙盒通用配置](./common)单独部署。
下面示例使用国内镜像源。海外部署可将镜像替换为:
- `opensandbox/server:v0.1.9`
- `ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0`
- `opensandbox/execd:v1.0.6`
- `opensandbox/egress:v1.0.1`
- `ghcr.io/labring/fastgpt-agent-volume-manager:v0.2.0`
## 2. 修改 OpenSandbox 变量
根据实际部署环境修改下面变量:
| 配置 | 说明 |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `x-volume-manager-auth-token` | `fastgpt-volume-manager` 的认证 Token,需要与 FastGPT 里的 `AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN` 一致。 |
| `[server].api_key` | OpenSandbox Server API Key,需要与 FastGPT 里的 `AGENT_SANDBOX_OPENSANDBOX_API_KEY` 一致。 |
Docker runtime 必须挂载宿主机 Docker socket。Docker 默认路径通常是 `/var/run/docker.sock`;OrbStack 等环境需要替换为实际 socket 路径。
如果服务器配置了 `HTTP_PROXY` / `HTTPS_PROXY`,建议给 OpenSandbox Server 和 Volume Manager 补充 `NO_PROXY` / `no_proxy`,至少包含 `localhost,127.0.0.1,127.0.0.0/8,fastgpt-opensandbox-server,fastgpt-volume-manager,host.docker.internal`,避免内部服务调用被代理劫持。OrbStack/Docker 可能自动注入包含 IPv6 CIDR 的 `NO_PROXY`,OpenSandbox 依赖的 httpx 可能把未加方括号的 IPv6 CIDR 误解析成 URL 端口,导致启动失败;遇到该问题时应显式覆盖 `NO_PROXY`。
## 3. 修改 FastGPT 相关变量
在 `fastgpt-app` 和 `fastgpt-pro` 中增加或修改下面环境变量:
```dotenv
# 启用 OpenSandbox 作为 Agent Sandbox provider
AGENT_SANDBOX_PROVIDER=opensandbox
# FastGPT 主服务访问 OpenSandbox Server 的内网地址
AGENT_SANDBOX_OPENSANDBOX_BASEURL=http://fastgpt-opensandbox-server:8090
# OpenSandbox 访问密钥,需要与 opensandbox-config 里的 [server].api_key 一致
AGENT_SANDBOX_OPENSANDBOX_API_KEY=replace_with_opensandbox_api_key
# Docker compose 部署使用 docker runtime
AGENT_SANDBOX_OPENSANDBOX_RUNTIME=docker
# OpenSandbox 创建 Agent Sandbox 时使用的运行态镜像
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO=registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG=v0.2.0
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY=true
# 持久卷管理服务地址和 Token,需要与 x-volume-manager-auth-token 一致。
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL=http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN=replace_with_volume_manager_token
```
如果你的 `docker-compose.yml` 已经使用 `x-agent-sandbox-config` 统一注入 Agent Sandbox 变量,可直接在该 anchor 中填入上述值,确保 `fastgpt-app` 和 `fastgpt-pro` 都继承该配置。
## 4. 启动验证
1. 预拉取沙盒运行时镜像:
```bash
docker compose --profile prepull pull opensandbox-agent-sandbox-image opensandbox-execd-image opensandbox-egress-image
```
2. 启动或重启相关服务:
```bash
docker compose up -d fastgpt-opensandbox-server fastgpt-volume-manager fastgpt-app fastgpt-pro
```
3. 在容器网络内检查服务健康状态:
```bash
docker compose exec fastgpt-opensandbox-server python -c "import urllib.request; print(urllib.request.urlopen('http://localhost:8090/health', timeout=5).read().decode())"
docker compose exec fastgpt-volume-manager node -e "fetch('http://localhost:3000/health').then(async r => { console.log(await r.text()); if (!r.ok) process.exit(1); })"
```
正常情况下,OpenSandbox 的健康检查会返回 `OK`,`fastgpt-volume-manager` 会返回健康状态 JSON。Agent Sandbox Proxy 的验证方式见[沙盒通用配置](./common)。
4. 登录 FastGPT,打开支持 Agent Sandbox 的场景,例如 Agent V2 虚拟机、Skill 编辑或 Skill 调试,确认可以正常创建沙盒、打开文件树和终端。
## 常见问题
### 提示 Sandbox provider apiKey is required for opensandbox
检查 `fastgpt-app` 和 `fastgpt-pro` 是否配置了 `AGENT_SANDBOX_OPENSANDBOX_API_KEY`,并确认它与 `opensandbox-config` 中的 `[server].api_key` 一致。
### 提示 AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL is required
OpenSandbox 模式需要部署 `fastgpt-volume-manager`,并在 FastGPT 中配置 `AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL` 和 `AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN`。
### 沙盒创建成功,但文件树或终端连接失败
检查 `AGENT_SANDBOX_PROXY_URL` 是否是浏览器可访问的 `ws://` 或 `wss://` 地址,并确认反向代理支持 WebSocket Upgrade。如果 FastGPT 主站使用 HTTPS,proxy 地址也应使用 `wss://`。
### proxy 无法连接沙盒 endpoint
优先检查 `opensandbox-config` 的 `[docker].host_ip`。当 OpenSandbox Server 运行在容器内时,沙盒 endpoint 里的 `localhost` 或 `127.0.0.1` 对 proxy 容器不可达,通常需要改成宿主机内网 IP 或 `host.docker.internal`。
---
title: Deploy with Docker-compose
title: Deploy with Docker Compose
description: Quickly deploy FastGPT using Docker Compose
---
......@@ -124,40 +124,77 @@ Run in Linux/MacOS/Windows WSL. The script guides you through selecting deployme
bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh)
```
The script automatically:
- Downloads or copies `docker-compose.yml`, and downloads `config.json`.
- Guides you through selecting externally accessible S3 and MCP addresses, then writes them into the config files.
- Generates a random `root` login password, service tokens, app keys, and component passwords, then writes them into `docker-compose.yml`.
- Detects the host Docker socket path and updates the mount path in `docker-compose.yml` when needed.
After the script finishes, the terminal prints the generated `root` login password. Keep the generated `docker-compose.yml` safe. For future upgrades, start from this file so you do not lose the generated passwords and keys.
To use an existing local `docker-compose.yml` file, for example when testing a version that has not been published to the docs site yet, choose `本地 docker-compose.yml` (local docker-compose.yml) in the deployment version step and enter the local file path. You can also pass the path with an environment variable:
```bash
FASTGPT_LOCAL_COMPOSE_PATH=/path/to/docker-compose.yml bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh)
```
#### Method 2: Manual Download
If your environment is non-\*nix or can't access external networks, manually download `docker-compose.yml`.
If you need to pin deployment to a specific `docker-compose.yml` file, we recommend downloading both `docker-compose.yml` and `install.sh`, then using the script's local compose mode to generate the final config. This keeps the script's random credential generation, S3/MCP address updates, and Docker socket detection.
1. Download the `docker-compose.yml` file:
1. Download the required `docker-compose.yml` file to the server, for example:
```bash
curl -fsSL https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.pg.yml -o docker-compose.source.yml
```
<details>
<summary>Click to view docker-compose config file download links for different databases</summary>
- **Pgvector**
- China mirror (Alibaba Cloud): [docker-compose.pg.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/cn/docker-compose.pg.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.pg.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/global/docker-compose.pg.yml)
- China mirror (Alibaba Cloud): [docker-compose.pg.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.pg.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.pg.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/global/docker-compose.pg.yml)
- **Oceanbase**
- China mirror (Alibaba Cloud): [docker-compose.oceanbase.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/cn/docker-compose.oceanbase.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.oceanbase.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/global/docker-compose.oceanbase.yml)
- China mirror (Alibaba Cloud): [docker-compose.oceanbase.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.oceanbase.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.oceanbase.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/global/docker-compose.oceanbase.yml)
- **Milvus**
- China mirror (Alibaba Cloud): [docker-compose.milvus.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/cn/docker-compose.milvus.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.milvus.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/global/docker-compose.milvus.yml)
- China mirror (Alibaba Cloud): [docker-compose.milvus.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.milvus.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.milvus.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/global/docker-compose.milvus.yml)
- **Zilliz**
- China mirror (Alibaba Cloud): [docker-compose.zilliz.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/cn/docker-compose.zilliz.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.zilliz.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/global/docker-compose.zilliz.yml)
- China mirror (Alibaba Cloud): [docker-compose.zilliz.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.zilliz.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.zilliz.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/global/docker-compose.zilliz.yml)
- **SeekDB**
- China mirror (Alibaba Cloud): [docker-compose.seekdb.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/cn/docker-compose.seekdb.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.seekdb.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/global/docker-compose.seekdb.yml)
- China mirror (Alibaba Cloud): [docker-compose.seekdb.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.seekdb.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.seekdb.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/global/docker-compose.seekdb.yml)
2. Download the `config.json` file:
</details>
- [config.json](https://doc.fastgpt.cn/deploy/config/config.json)
2. Download `install.sh` to the server:
</details>
```bash
curl -fsSL https://doc.fastgpt.cn/deploy/install.sh -o install.sh
```
3. Run `install.sh` with the local compose file to generate the final deployment config:
Download config.json file:
```bash
FASTGPT_LOCAL_COMPOSE_PATH=./docker-compose.source.yml bash install.sh
```
The script copies this compose file to the final `docker-compose.yml`, then downloads `config.json`, generates login passwords and credentials, and writes the S3/MCP addresses. After generation, log in with the root password printed in the terminal.
For a fully offline environment, prepare `docker-compose.yml`, `config.json`, and `install.sh` in advance. If the script cannot download `config.json`, manually update `DEFAULT_ROOT_PSW`, service tokens, database passwords, and S3/MCP addresses.
- [config.json](https://doc.fastgpt.cn/deploy/config/config.json)
#### Deploy with a Custom Image Registry
If you use an internal Harbor, private registry, or image mirror, download `docker-compose.yml` first, replace all `image:` values with your own registry addresses, and then use local compose mode:
```bash
FASTGPT_LOCAL_COMPOSE_PATH=./docker-compose.yml bash install.sh
```
If Agent/Skill Sandbox is enabled, deploy `fastgpt-agent-sandbox-proxy` separately and also replace `AGENT_SANDBOX_SEALOS_IMAGE` or `AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO` so the sandbox provider can pull the `fastgpt-agent-sandbox` image. The v4.15.0 default deployment file does not include `fastgpt-agent-sandbox-proxy` or start OpenSandbox by default. See the [V4.15.0 upgrade notes](../upgrading/4-15/41500.en.mdx#5-agent-sandbox-deployment-options) for sandbox provider setup.
### 2. Modify Environment Variables
......@@ -169,7 +206,7 @@ These ports must be accessible:
1. Port 3000 (FastGPT main service)
2. Port 9000 (S3 service)
3. Port 3005 (FastGPT SSE MCP server service)
3. Port 3003 (FastGPT SSE MCP server service)
### 4. Start Containers
......@@ -177,14 +214,15 @@ Run in the same directory as docker-compose.yml. Ensure `docker-compose` version
```bash
# Start containers
docker compose --profile prepull pull opensandbox-agent-sandbox-image opensandbox-execd-image opensandbox-egress-image && dockercompose up -d
docker compose up -d
```
### 5. Access FastGPT
Access FastGPT via the port/domain opened in step 3.
Login username is `root`, password is the `DEFAULT_ROOT_PSW` set in `docker-compose.yml` environment variables.
Each container restart automatically initializes the root user with password `1234` (matching `DEFAULT_ROOT_PSW`).
If you deploy with the interactive script, it randomly generates `DEFAULT_ROOT_PSW` and prints the login password when it finishes. If you deploy manually, change the default password in `docker-compose.yml` before starting the service. Each container restart automatically updates the root user's password based on `DEFAULT_ROOT_PSW`.
### 6. Configure Models
......@@ -318,20 +356,9 @@ docker compose up -d
4. Run initialization scripts (if any)
### How to Customize Configuration Files?
Modify `config.json`, then run `docker compose down` followed by `docker compose up -d` to restart. For details, see [Configuration Guide](../config/json.en.mdx).
### How to Check if Custom Config File is Mounted
1. `docker logs fastgpt` shows logs. After starting the container, the first web request reads the config file — check for success or error messages.
2. `docker exec -it fastgpt sh` enters the container. Use `ls data` to check if `config.json` is mounted. Use `cat data/config.json` to view it.
**Possible reasons it's not working:**
### How to Customize Environment Variables?
1. Incorrect mount directory
2. Invalid config file — logs will show `invalid json`. The file must be valid JSON.
3. Didn't run `docker compose down` then `docker compose up -d` after changes. A simple restart doesn't remount files.
Edit the `environment` section of `fastgpt-app` in `docker-compose.yml`, then run `docker compose up -d` to restart the container. For details, see [Environment Variables](../config/env.en.mdx).
### How to Check if Environment Variables Loaded
......
---
title: Docker-compose 部署
title: Docker Compose 部署
description: 使用 Docker Compose 快速部署 FastGPT
---
......@@ -124,40 +124,71 @@ brew install orbstack
bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh)
```
脚本会自动完成以下操作:
- 下载或复制 `docker-compose.yml`,并下载 `config.json`。
- 引导选择 S3 与 MCP 的外部访问地址,并写入配置文件。
- 随机生成 `root` 登录密码、服务间 Token、应用密钥和组件密码,并写入 `docker-compose.yml`。
- 自动检测宿主机 Docker socket 路径,必要时替换 `docker-compose.yml` 中的挂载路径。
执行完成后,终端会输出本次生成的 `root` 登录密码,请妥善保存生成后的 `docker-compose.yml`。后续升级时建议基于该文件调整,不要直接丢失已生成的密码和密钥。
#### 方法二:手动下载部署
如果部署环境为非 \*nix 环境或无法访问外网,需要手动下载 `docker-compose.yml` 进行部署
如果需要固定使用某个 `docker-compose.yml` 文件,推荐先手动下载 `docker-compose.yml` 和 `install.sh`,再通过 `install.sh` 的本地 compose 模式生成最终配置。这样仍然可以复用脚本里的随机密码、S3/MCP 地址写入、Docker socket 检测等能力。
1. 下载 `docker-compose.yml` 文件:
1. 下载所需的 `docker-compose.yml` 文件到服务器,例如:
```bash
curl -fsSL https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.pg.yml -o docker-compose.source.yml
```
<details>
<summary>点击展开查看不同数据库的 docker-compose 配置文件下载地址</summary>
- **Pgvector**
- 中国大陆地区镜像源(阿里云):[docker-compose.pg.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/cn/docker-compose.pg.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.pg.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/global/docker-compose.pg.yml)
- 中国大陆地区镜像源(阿里云):[docker-compose.pg.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.pg.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.pg.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/global/docker-compose.pg.yml)
- **Oceanbase**
- 中国大陆地区镜像源(阿里云):[docker-compose.oceanbase.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/cn/docker-compose.oceanbase.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.oceanbase.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/global/docker-compose.oceanbase.yml)
- 中国大陆地区镜像源(阿里云):[docker-compose.oceanbase.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.oceanbase.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.oceanbase.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/global/docker-compose.oceanbase.yml)
- **Milvus**
- 中国大陆地区镜像源(阿里云):[docker-compose.milvus.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/cn/docker-compose.milvus.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.milvus.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/global/docker-compose.milvus.yml)
- 中国大陆地区镜像源(阿里云):[docker-compose.milvus.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.milvus.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.milvus.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/global/docker-compose.milvus.yml)
- **Zilliz**
- 中国大陆地区镜像源(阿里云):[docker-compose.zilliz.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/cn/docker-compose.zilliz.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.zilliz.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/global/docker-compose.zilliz.yml)
- 中国大陆地区镜像源(阿里云):[docker-compose.zilliz.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.zilliz.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.zilliz.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/global/docker-compose.zilliz.yml)
- **SeekDB**
- 中国大陆地区镜像源(阿里云):[docker-compose.seekdb.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/cn/docker-compose.seekdb.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.seekdb.yml](https://doc.fastgpt.cn/deploy/docker/v4.14/global/docker-compose.seekdb.yml)
- 中国大陆地区镜像源(阿里云):[docker-compose.seekdb.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.seekdb.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.seekdb.yml](https://doc.fastgpt.cn/deploy/docker/v4.15/global/docker-compose.seekdb.yml)
</details>
2. 下载 `config.json` 文件:
2. 下载 `install.sh` 到服务器:
- [config.json](https://doc.fastgpt.cn/deploy/config/config.json)
```bash
curl -fsSL https://doc.fastgpt.cn/deploy/install.sh -o install.sh
```
</details>
3. 使用 `install.sh` 读取本地 compose 文件并生成最终部署配置:
```bash
FASTGPT_LOCAL_COMPOSE_PATH=./docker-compose.source.yml bash install.sh
```
下载 config.json 文件
脚本会复制该 compose 文件为最终的 `docker-compose.yml`,并继续下载 `config.json`、随机生成登录密码和各类凭证、写入 S3/MCP 地址。生成完成后,按终端输出的 root 密码登录。
- [config.json](https://doc.fastgpt.cn/deploy/config/config.json)
完全离线环境下,需要同时准备 `docker-compose.yml`、`config.json` 和 `install.sh`。如果无法让脚本下载 `config.json`,则需要手动修改 `DEFAULT_ROOT_PSW`、服务 Token、数据库密码、S3/MCP 地址等配置。
#### 自定义镜像源部署
如果需要使用企业内网 Harbor、私有 Registry 或自建镜像加速源,可以先下载 `docker-compose.yml`,把所有 `image:` 改成自己的镜像地址,再走本地 compose 模式:
```bash
FASTGPT_LOCAL_COMPOSE_PATH=./docker-compose.yml bash install.sh
```
如果启用 Agent/Skill 沙盒,还需要单独部署 `fastgpt-agent-sandbox-proxy`,并同步替换 `AGENT_SANDBOX_SEALOS_IMAGE` 或 `AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO`,确保沙盒 provider 可以拉取 `fastgpt-agent-sandbox` 镜像。v4.15.0 默认部署文件不内置 `fastgpt-agent-sandbox-proxy`,也不会默认启动 OpenSandbox;沙盒 provider 的接入方式见 [V4.15.0 升级说明](../upgrading/4-15/41500.mdx#5-agent-sandbox-部署方案)。
### 2. 修改环境变量
......@@ -169,7 +200,7 @@ bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh)
1. 3000 端口(FastGPT 主服务)
2. 9000 端口(S3 服务)
3. 3005 端口(FastGPT SSE MCP server 服务)
3. 3003 端口(FastGPT SSE MCP server 服务)
### 4. 启动容器
......@@ -177,13 +208,14 @@ bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh)
```bash
# 启动容器
docker compose --profile prepull pull opensandbox-agent-sandbox-image opensandbox-execd-image opensandbox-egress-image && docker compose up -d
docker compose up -d
```
### 5. 访问 FastGPT
可通过第二步开放的端口/域名访问 FastGPT。登录用户名为 `root`,密码为 `docker-compose.yml` 环境变量里设置的 `DEFAULT_ROOT_PSW`。每次重启容器,都会自动初始化 root 用户,密码为 `1234`(与环境变量中的 `DEFAULT_ROOT_PSW` 一致)。
可通过第三步开放的端口/域名访问 FastGPT。登录用户名为 `root`,密码为 `docker-compose.yml` 环境变量里设置的 `DEFAULT_ROOT_PSW`。
如果使用交互式脚本部署,脚本会随机生成 `DEFAULT_ROOT_PSW`,并在执行完成后输出本次登录密码;如果手动下载部署,请自行修改 `docker-compose.yml` 中的默认密码后再启动服务。每次重启容器,都会按 `DEFAULT_ROOT_PSW` 自动更新 root 用户密码。
### 6. 配置模型
......@@ -316,20 +348,9 @@ docker compose up -d
4. 执行初始化脚本(如果有)
### 如何自定义配置文件?
修改 `config.json` 文件,并执行 `docker compose down` 再执行 `docker compose up -d` 重起容器。具体配置,参考[配置详解](../config/json.mdx)。
### 如何检查自定义配置文件是否挂载
1. `docker logs fastgpt` 可以查看日志,在启动容器后,第一次请求网页,会进行配置文件读取,可以看看有没有读取成功以及有无错误日志。
2. `docker exec -it fastgpt sh` 进入 FastGPT 容器,可以通过 `ls data` 查看目录下是否成功挂载 `config.json` 文件。可通过 `cat data/config.json` 查看配置文件。
**可能不生效的原因**
### 如何自定义环境变量?
1. 挂载目录不正确
2. 配置文件不正确,日志中会提示 `invalid json`,配置文件需要是标准的 JSON 文件。
3. 修改后,没有 `docker compose down` 再 `docker compose up -d`,restart 是不会重新挂载文件的。
修改 `docker-compose.yml` 中 `fastgpt-app` 的 `environment` 配置,并执行 `docker compose up -d` 重启容器。具体配置参考[环境变量说明](../config/env.mdx)。
### 如何检查环境变量是否正常加载
......
......@@ -104,7 +104,8 @@ In **App Launchpad**, select FastGPT, click **Change**, and you'll see environme
![](../../../public/imgs/fastgptonsealos1.png)
<Alert icon="🤖" context="success">
On Sealos, FastGPT runs 1 service and 2 databases. When pausing or deleting, handle the databases together. (You can start them during the day and pause at night to save costs.)
On Sealos, FastGPT runs 1 service and 2 databases. When pausing or deleting, handle the databases
together. (You can start them during the day and pause at night to save costs.)
</Alert>
### How to Update/Upgrade FastGPT
......@@ -138,13 +139,13 @@ Click **Change** on the app -> **Custom Domain** -> enter domain -> configure do
![](../../../public/imgs/onsealos4.png)
### How to Modify Config Files
### How to Modify Environment Variables
Open Sealos app management -> find the app -> **Change** -> scroll down to advanced configuration where you'll find config files -> add new or click an existing config file to edit -> click confirm change in the top right.
Open Sealos app management -> find the app -> **Change** -> edit environment variables -> click confirm change in the top right.
![](../../../public/imgs/onsealos5.png)
[Config file reference](../config/json.en.mdx)
[Environment Variables](../config/env.en.mdx)
### Modify Site Name and Favicon
......
......@@ -11,7 +11,7 @@ import { Alert } from '@/components/docs/Alert';
## 多模型支持
FastGPT 使用了 one-api 项目来管理模型池,其可以兼容 OpenAI 、Azure 、国内主流模型和本地模型等。
FastGPT 使用了 one-api 项目来管理模型池,其可以兼容 OpenAI、Azure、国内主流模型和本地模型等。
可参考:[Sealos 快速部署 OneAPI](../config/model/intro.mdx)
......@@ -53,11 +53,11 @@ FastGPT 使用了 one-api 项目来管理模型池,其可以兼容 OpenAI 、A
由于需要部署数据库,部署完后需要等待 2~4 分钟才能正常访问。默认用了最低配置,首次访问时会有些慢。
根据提示,输入`root_password`,和 `openai`/`oneapi` 的地址和密钥。
根据提示,输入 `root_password`,和 `openai` / `oneapi` 的地址和密钥。
![](../../../public/imgs/sealos1.png)
点击部署后,会跳转到应用管理页面。可以点击`fastgpt`主应用右侧的详情按键(名字为 fastgpt-xxxx), 如下图所示。
点击部署后,会跳转到应用管理页面。可以点击 `fastgpt` 主应用右侧的详情按键(名字为 fastgpt-xxxx),如下图所示。
![](../../../public/imgs/sealos-deploy1.jpg)
......@@ -71,7 +71,7 @@ FastGPT 使用了 one-api 项目来管理模型池,其可以兼容 OpenAI 、A
用户名:`root`
密码是刚刚一键部署时设置的`root_password`
密码是刚刚一键部署时设置的 `root_password`
### 3. 配置模型
......@@ -83,13 +83,13 @@ FastGPT 使用了 one-api 项目来管理模型池,其可以兼容 OpenAI 、A
## 收费
Sealos 采用按量计费的方式,也就是申请了多少 cpu、内存、磁盘,就按该申请量进行计费。具体的计费标准,可以打开`sealos`控制面板中的`费用中心`进行查看。
Sealos 采用按量计费的方式,也就是申请了多少 cpu、内存、磁盘,就按该申请量进行计费。具体的计费标准,可以打开 `sealos` 控制面板中的 `费用中心` 进行查看。
## Sealos 使用
### 简介
FastGPT 商业版共包含了2个应用(fastgpt, fastgpt-plus)和2个数据库,使用多 Api Key 时候需要安装 OneAPI(一个应用和一个数据库),总计3个应用和3个数据库。
FastGPT 商业版共包含了 2 个应用(fastgpt, fastgpt-plus)和 2 个数据库,使用多 API Key 时候需要安装 OneAPI(一个应用和一个数据库),总计 3 个应用和 3 个数据库。
![](../../../public/imgs/onSealos1.png)
......@@ -97,9 +97,9 @@ FastGPT 商业版共包含了2个应用(fastgpt, fastgpt-plus)和2个数据
### 修改配置文件和环境变量
在 Sealos 中,你可以打开`应用管理`(App Launchpad)看到部署的 FastGPT,可以打开`数据库`(Database)看到对应的数据库。
在 Sealos 中,你可以打开 `应用管理`(App Launchpad)看到部署的 FastGPT,可以打开 `数据库`(Database)看到对应的数据库。
在`应用管理`中,选中 FastGPT,点击变更,可以看到对应的环境变量和配置文件。
在 `应用管理` 中,选中 FastGPT,点击变更,可以看到对应的环境变量和配置文件。
![](../../../public/imgs/fastgptonsealos1.png)
......@@ -110,16 +110,16 @@ FastGPT 商业版共包含了2个应用(fastgpt, fastgpt-plus)和2个数据
### 如何更新/升级 FastGPT
[升级脚本文档](../upgrading/upgrade-intruction.mdx)先看下文档,看下需要升级哪个版本。注意,不要跨版本升级!!!!!
[升级脚本文档](../upgrading/upgrade-intruction.mdx)先看下文档,看下需要升级哪个版本。注意,不要跨版本升级。
例如,目前是4.5 版本,要升级到4.5.1,就先把镜像版本改成v4.5.1,执行一下升级脚本,等待完成后再继续升级。如果目标版本不需要执行初始化,则可以跳过。
例如,目前是 4.5 版本,要升级到 4.5.1,就先把镜像版本改成 v4.5.1,执行一下升级脚本,等待完成后再继续升级。如果目标版本不需要执行初始化,则可以跳过。
升级步骤:
1. 查看[更新文档](../upgrading/upgrade-intruction.mdx),确认要升级的版本,避免跨版本升级。
2. 打开 sealos 的应用管理
3. 有2个应用 fastgpt , fastgpt-pro
4. 点击对应应用右边3个点,变更。或者点详情后右上角的变更。
3. 有 2 个应用 fastgpt、fastgpt-pro
4. 点击对应应用右边 3 个点,变更。或者点详情后右上角的变更。
5. 修改镜像的版本号
![](../../../public/imgs/onsealos2.png)
......@@ -135,17 +135,17 @@ FastGPT 商业版共包含了2个应用(fastgpt, fastgpt-plus)和2个数据
### 配置自定义域名
点击对应应用的变更->点击自定义域名->填写域名-> 操作域名 Cname -> 确认 -> 确认变。
点击对应应用的变更 ->点击自定义域名 ->填写域名 -> 操作域名 Cname -> 确认 -> 确认变。
![](../../../public/imgs/onsealos4.png)
### 如何修改配置文件
### 如何修改环境变量
打开 Sealos 的应用管理 -> 找到对应的应用 -> 变更 -> 往下拉到高级配置,里面有个配置文件 -> 新增或点击对应的配置文件可以进行编辑 -> 点击右上角确认变。
打开 Sealos 的应用管理 -> 找到对应的应用 -> 变更 -> 修改环境变量 -> 点击右上角确认变。
![](../../../public/imgs/onsealos5.png)
[配置文件参考](../config/json.mdx)
[环境变量说明](../config/env.mdx)
### 修改站点名称以及 favicon
......@@ -162,10 +162,9 @@ SYSTEM_FAVICON 可以是一个网络地址
![](../../../public/imgs/onsealos6.png)
### 挂载logo
### 挂载 logo
目前暂时无法 把浏览器上的logo替换。仅支持svg,待后续可视化做了后可以全部替换。
新增一个挂载文件,文件名为:/app/projects/app/public/icon/logo.svg ,值为 svg 对应的值。
目前暂时无法把浏览器上的 logo 替换。仅支持 svg,待后续可视化做了后可以全部替换。新增一个挂载文件,文件名为:/app/projects/app/public/icon/logo.svg,值为 svg 对应的值。
![](../../../public/imgs/onsealos7.png)
......
......@@ -3,108 +3,362 @@ title: 'V4.15.0'
description: 'FastGPT V4.15.0 Release Notes'
---
import { Alert } from '@/components/docs/Alert';
## 📦 Upgrade Guide
### 1. Image Changes
### 1. Environment Variable Changes
#### 1.1 fastgpt-app and fastgpt-pro
##### Check required variables
v4.15.0 introduces stricter environment variable validation. After upgrading, make sure the following variables are configured correctly.
- Update the fastgpt-app (FastGPT main service) image tag to v4.15.0
- Update the fastgpt-pro (FastGPT commercial edition) image tag to v4.15.0
- Update the fastgpt-code-sandbox image tag to v4.15.0
- Update the fastgpt-plugin image tag to v1.0.0-beta2
- Update the aiproxy image tag to v0.6.1
```dotenv
# Encryption key. Must be the same in both services.
AES256_SECRET_KEY=
# File token key. Must be the same in both services.
FILE_TOKEN_KEY=
# JWT secret for invoke callbacks. Must be at least 32 characters and the same in both services.
INVOKE_TOKEN_SECRET=
```
If you use OpenSandbox, update the following images:
##### New environment variables
- Update the fastgpt-agent-sandbox image tag to v0.2.0
- Update the fastgpt-agent-volume-manager image tag to v0.2.0
**Required**
### 2. Environment Variable Changes
```dotenv
# SSE MCP Server address. Leave empty if you do not use SSE.
SSE_MCP_SERVER_PROXY_ENDPOINT=
```
#### FastGPT Main Service
**Optional**
For `fastgpt-app` and `fastgpt-pro`, this upgrade only requires attention to the following newly added settings or changed semantics. For the complete environment variable list, see [Environment Variables](../../config/env.en.mdx).
The following variables have defaults or can be left unset without affecting normal usage.
```dotenv
# File parsing worker concurrency
# File parsing worker concurrency (optional)
PARSE_FILE_WORKERS=10
# File parsing timeout in seconds
# File parsing timeout in seconds (optional)
PARSE_FILE_TIMEOUT_SECONDS=600
# HTML-to-Markdown worker concurrency
# HTML-to-Markdown worker concurrency (optional)
HTML_TO_MARKDOWN_WORKERS=10
# Text chunking worker concurrency
# Text chunking worker concurrency (optional)
TEXT_TO_CHUNKS_WORKERS=10
# Automatically sync MongoDB indexes. Use a boolean string instead of 0 or 1
# Automatically sync MongoDB indexes. Use boolean strings instead of 0 or 1. (optional)
SYNC_INDEX=true
# Whether to enable trusted reverse proxy client IP verification
# Whether to enable trusted reverse proxy client IP verification (optional)
TRUSTED_PROXY_ENABLE=false
# Trusted reverse proxy IP/CIDR list, separated by commas or whitespace. Only effective when TRUSTED_PROXY_ENABLE=true
# Trusted reverse proxy IP/CIDR list, separated by commas or whitespace. Only takes effect when TRUSTED_PROXY_ENABLE=true.
# Only X-Forwarded-For/X-Real-IP from explicitly trusted proxies will be used for client IP resolution. (optional)
TRUSTED_PROXY_IPS=
# Maximum number of characters for synchronous system string processing, in M. Range: 1-100
# Maximum string length for synchronous system variable replacement, in M. Range: 1-100.
SYSTEM_MAX_STRING_LENGTH_M=100
# Maximum folder depth. Default: 4. Range: 2-20
# Maximum folder depth. Default: 4. Range: 2-20.
MAX_FOLDER_DEPTH=4
# Maximum input array length for Loop/Parallel nodes
WORKFLOW_MAX_LOOP_TIMES=100
# Parallel node concurrency limit. The final value is clamped to [5, 100]
# Parallel node concurrency limit. The final value is clamped to [5, 100].
WORKFLOW_PARALLEL_MAX_CONCURRENCY=10
# Agent Sandbox disk-size baseline, in MB
AGENT_SANDBOX_DISK_MB=1024
# Registry used by npm/yarn/bun inside Agent Sandbox
AGENT_SANDBOX_NPM_REGISTRY=
# Python package index used by pip/uv inside Agent Sandbox
AGENT_SANDBOX_PYPI_INDEX_URL=
```
This release adds environment variable validation. Check that both `fastgpt-app` and `fastgpt-pro` include `AES256_SECRET_KEY` and `FILE_TOKEN_KEY`, and that the values are the same in both services.
##### Open-source edition variable changes
#### Plugin Service
The open-source edition no longer uses the `config.json` configuration file. These settings have moved to environment variables. After removing the volume mount, add the following variables as needed:
The plugin service has been upgraded to v1.0.0-beta2, and system tool execution has changed significantly:
```dotenv
# Custom PDF parsing service URL
CUSTOM_PDF_PARSE_URL=
# Custom PDF parsing service key
CUSTOM_PDF_PARSE_KEY=
# Doc2x PDF parsing service key
DOC2X_KEY=
# TextIn service App ID
TEXTIN_APP_ID=
# TextIn service Secret Code
TEXTIN_SECRET_CODE=
# hnsw ef_search parameter for vector search. Only applies to PG / OB / OpenGauss.
HNSW_EF_SEARCH=100
# Maximum vector scan tuple count. Only applies to PG.
HNSW_MAX_SCAN_TUPLES=100000
# Maximum Knowledge Base file parsing queue concurrency
DATASET_PARSE_MAX_PROCESS=10
# Maximum vector training queue concurrency
VECTOR_MAX_PROCESS=10
# Maximum Q&A split queue concurrency
QA_MAX_PROCESS=10
# Maximum vision-language model processing queue concurrency
VLM_MAX_PROCESS=10
```
#### 1.2 code-sandbox
Code Sandbox adds security-related environment variables such as `SANDBOX_API_MAX_BODY_MB` and `SANDBOX_MAX_OUTPUT_MB`, and supports grouped run queueing through `queueId`. Full defaults:
1. Update the `AUTH_TOKEN` environment variable for `fastgpt-plugin`. It must be at least 32 characters long.
2. Update the `PLUGIN_TOKEN` environment variable for `fastgpt` to match the `AUTH_TOKEN` value used by `fastgpt-plugin`.
3. Update the database name in the `MONGODB_URI` environment variable for `fastgpt-plugin` so it does not conflict with the MongoDB database name used by `fastgpt`. For example: `mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin`
| Variable | Default | Description |
| --------------------------------- | ------- | ----------------------------------------------------------------------------------------------------- |
| `SANDBOX_API_MAX_BODY_MB` | `8` | Maximum `/sandbox` API JSON body size, including `variables`, in MB. |
| `SANDBOX_MAX_OUTPUT_MB` | `10` | Maximum output JSON size for one code execution, including return values and logs, in MB. |
| `CHECK_INTERNAL_IP` | `true` | Enables internal IP checks for sandbox network requests by default to reduce SSRF risk. |
| `SANDBOX_MAX_TIMEOUT` | `60000` | Timeout for one code execution, in milliseconds. |
| `SANDBOX_MAX_MEMORY_MB` | `256` | Memory limit for one sandbox, in MB. The runtime reserves an extra `50` MB for overhead. |
| `SANDBOX_POOL_SIZE` | `20` | Number of pre-warmed JS/Python workers. |
| `SANDBOX_REQUEST_MAX_COUNT` | `30` | Maximum number of network requests allowed during one code execution. |
| `SANDBOX_REQUEST_TIMEOUT` | `60000` | Timeout for one network request from inside the sandbox, in milliseconds. |
| `SANDBOX_REQUEST_MAX_RESPONSE_MB` | `10` | Maximum response body size for one sandbox network request, in MB. |
| `SANDBOX_REQUEST_MAX_BODY_MB` | `5` | Maximum request body size for one sandbox network request, in MB. |
| `SANDBOX_QUEUE_ID_CONCURRENCY` | Empty | Number of requests with the same `queueId` that may enter execution at once. Empty disables queueing. |
#### OpenSandbox
#### 1.3 fastgpt-plugin
If you use OpenSandbox, `AGENT_SANDBOX_VOLUME_MANAGER_MOUNT_PATH` is no longer effective and can be removed. OpenSandbox now always mounts persistent data to `/workspace`, which affects the old sandbox persistence behavior.
The plugin service has been reworked. You must add `AUTH_TOKEN` and `FASTGPT_BASE_URL`, and update the `MONGODB_URI` variable:
#### Code Sandbox
1. Set `AUTH_TOKEN` for `fastgpt-plugin`. It must be at least 32 characters long.
2. Set `PLUGIN_TOKEN` in both `fastgpt` and `fastgpt-pro` to the same value as `fastgpt-plugin`'s `AUTH_TOKEN`.
3. Change the database name in `fastgpt-plugin`'s `MONGODB_URI` so it does not conflict with FastGPT's MongoDB database name. Example: `mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin`.
Code Sandbox adds request body, output size, and `queueId` queue controls:
**Additional variables you may adjust**
```dotenv
# Maximum JSON request body size for the /sandbox API, including variables, in MB
SANDBOX_API_MAX_BODY_MB=8
# Maximum JSON output size for a single code execution, including return values and logs, in MB
SANDBOX_MAX_OUTPUT_MB=10
# Number of requests with the same queueId that may enter execution concurrently. Empty disables queueing.
SANDBOX_QUEUE_ID_CONCURRENCY=
# ================ System =====================
# Auth token
AUTH_TOKEN=
# Maximum API request body size (MB)
MAX_API_SIZE=10
# FastGPT service URL. It can be an internal address and is used for callbacks to FastGPT APIs.
FASTGPT_BASE_URL=http://fastgpt-app:3000
# ================ Plugin runtime =====================
# Supported value: localPool
PLUGIN_RUNTIME_MODE=localPool
# Temporary file storage directory. Can be empty.
LOCAL_FILE_BASE_PATH=
# ================ Process pool =====================
# Health check interval (ms)
POOL_HEALTH_CHECK_INTERVAL=30000
# Maximum total process count
POOL_MAX_TOTAL_PODS=100
# Minimum process count for one Service
POOL_SERVICE_MIN_PODS=0
# Maximum process count for one Service
POOL_SERVICE_MAX_PODS=5
# Global idle timeout (ms)
POOL_SERVICE_IDLE_TIMEOUT=60000
# Process runtime timeout (ms)
POOL_SERVICE_POD_TIMEOUT=120000
# Maximum concurrent requests per process
POOL_SERVICE_MAX_CONCURRENT_REQUESTS_PER_POD=10
# Global maximum requests per process before automatic rotation
POOL_SERVICE_MAX_REQUESTS_PER_POD=100
# Global maximum process queue length
POOL_SERVICE_MAX_QUEUE_SIZE=500
# Global process queue timeout (ms)
POOL_SERVICE_QUEUE_TIMEOUT=60000
# Startup retry backoff base delay (ms)
POOL_SERVICE_STARTUP_RETRY_BASE_DELAY=1000
# Startup retry backoff maximum delay (ms)
POOL_SERVICE_STARTUP_RETRY_MAX_DELAY=10000
# ================ Database =====================
MONGODB_URI=mongodb://username:password@localhost:27017/fastgpt?authSource=admin&directConnection=true
MONGO_MAX_LINK=20
SYNC_INDEX=true
REDIS_URL=redis://default:password@localhost:6379/0
# ================ Object storage =====================
# S3 file prefix. Do not change it casually after use.
S3_FILE_BASE_PATH=system/plugin
STORAGE_VENDOR=minio
STORAGE_REGION=us-east-1
STORAGE_ACCESS_KEY_ID=minioadmin
STORAGE_SECRET_ACCESS_KEY=minioadmin
STORAGE_PUBLIC_BUCKET=fastgpt-public
STORAGE_PRIVATE_BUCKET=fastgpt-private
STORAGE_EXTERNAL_ENDPOINT=http://localhost:9000
STORAGE_S3_ENDPOINT=http://localhost:9000
STORAGE_S3_FORCE_PATH_STYLE=true
STORAGE_S3_MAX_RETRIES=3
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATH=
# ================ Logs =====================
LOG_ENABLE_CONSOLE=true
# Console log level: "trace" | "debug" | "info" | "warning" | "error" | "fatal"
LOG_CONSOLE_LEVEL=info
LOG_ENABLE_OTEL=false
# Minimum log level stored in OTEL
LOG_OTEL_LEVEL=info
LOG_OTEL_SERVICE_NAME=fastgpt-plugin
LOG_OTEL_URL=http://localhost:4318/v1/logs
# ================ Metrics =====================
METRICS_ENABLE_OTEL=false
METRICS_OTEL_SERVICE_NAME=fastgpt-plugin
METRICS_OTEL_URL=http://localhost:4318/v1/metrics
METRICS_EXPORT_INTERVAL_MS=30000
METRICS_EXPORT_TIMEOUT_MS=10000
METRICS_INCLUDE_PLUGIN_VERSION=true
METRICS_INCLUDE_PLUGIN_ETAG=false
METRICS_INCLUDE_HOSTNAME=true
# For multi-node deployments, use Pod UID / container id / instance id. Empty generates an opaque id.
SERVICE_INSTANCE_ID=
DEPLOYMENT_ENVIRONMENT=
```
`/sandbox/js` and `/sandbox/python` request bodies now support an optional `queueId` field. When `SANDBOX_QUEUE_ID_CONCURRENCY` is configured and the request includes a valid `queueId`, requests with the same `queueId` are queued in FIFO order. Requests with different `queueId` values, or requests without `queueId`, are not restricted by this setting and are only limited by the worker pool concurrency.
### 2. OpenSandbox Changes (as needed)
OpenSandbox and other sandbox provider settings have moved to [Sandbox Configuration](../../config/sandbox/common) and are no longer built into the deployment yml.
For this upgrade, focus on:
1. Deploying the `agent-sandbox-proxy` service.
2. Updating OpenSandbox-related image versions.
3. Updating related environment variables in `fastgpt-app` and `fastgpt-pro`.
### 3. Reinstall System Tools
### 3. Image Changes
- Update fastgpt-app (FastGPT main service) image tag: v4.15.0
- Update fastgpt-pro (FastGPT commercial edition) image tag: v4.15.0
- Update fastgpt-code-sandbox image tag: v4.15.0
- Update fastgpt-plugin image tag: v1.0.0
- Update aiproxy image tag: v0.6.5
If `opensandbox` is enabled, also update:
- fastgpt-agent-sandbox-proxy image tag: v0.2.0
- fastgpt-agent-sandbox image tag: v0.2.0
### 4. Start Services
Run `docker compose up -d` to restart services.
### 5. Reinstall System Tools
After upgrading the plugin service, reinstall all legacy system tools:
1. Download the [zip package](<https://github.com/labring/fastgpt-img/raw/refs/heads/main/fastgpt-official-plugins(1).zip>) that contains all system tools.
2. Open the `fastgpt` web app, go to `Admin` in the navbar, click Add Plugin, click `Import/Update Plugin`, upload the zip package, and confirm.
2. Open the `fastgpt` web app, click `Admin` in the navbar, click Add Plugin, click `Import/Update Plugin`, upload the zip package, and confirm.
You can also install them one by one from the plugin marketplace: [https://v2.marketplace.fastgpt.cn](https://v2.marketplace.fastgpt.cn). The environment variable default now points to this address, so no marketplace-related variables are required.
### 6. Run Migration Scripts
You can also download tools one by one from the plugin marketplace. Before the stable release, the marketplace URL is: [https://v2.marketplace.fastgpt.cn](https://v2.marketplace.fastgpt.cn)
Before running scripts:
1. Back up MongoDB, object storage, and your current deployment configuration.
2. Upgrade `fastgpt-app` / `fastgpt-pro` to image versions that include these root-admin APIs.
3. Prepare a reachable FastGPT `{{host}}` and `{{rootkey}}`. All APIs below require `rootkey`.
#### 6.1 Clean Duplicate appId-chatId Records (optional, but recommended)
The stable release syncs two unique indexes: `{ appId, chatId }` and `{ sourceType, appId, chatId }`. Before the indexes sync successfully, check and clean duplicate `appId + chatId` records in the `chats` collection. Otherwise, when `SYNC_INDEX=true`, index sync may fail with `E11000 duplicate key error`, and the unique constraint will not take effect.
This API depends on the upgraded `fastgpt-app` image. If the first stable-release startup already reports a unique index conflict but the service is still reachable, run the dry-run and cleanup commands below, then restart the service so it can sync indexes again.
Run the dry-run first. This does not delete data, and every deployment should run it at least once:
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/cleanupDuplicateChats' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"dryRun":true,"sampleLimit":20}'
```
### 4. Upgrade Script
Check these response fields:
- `duplicateDocumentCount`: expected number of duplicate `chats` headers to delete.
- `samples`: duplicate samples, including the retained `keepId` and candidate `deleteIds`.
- `deletedDocumentCount`: number actually deleted during apply. It is always `0` in dry-run mode.
If `duplicateDocumentCount=0`, no apply step is needed. If it is greater than 0, confirm the samples and then apply the cleanup:
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/cleanupDuplicateChats' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"dryRun":false,"sampleLimit":20}'
```
Cleanup policy: for each duplicate `appId + chatId` group, the API keeps the record with the latest `updateTime`. If timestamps are equal, it uses `_id` descending as a stable tie-breaker. The API only deletes duplicate `chats` headers. It does not delete message content in `chatitems` or `chat_item_responses`.
After cleanup, keep `SYNC_INDEX=true` and restart `fastgpt-app` / `fastgpt-pro` so the service can sync indexes again. You can enter MongoDB and confirm both indexes are `unique: true`:
```js
db.chats
.getIndexes()
.filter((idx) => ['appId_1_chatId_1', 'sourceType_1_appId_1_chatId_1'].includes(idx.name));
```
#### 6.2 Workflow V1 -> V2 Migration (optional)
Run this only when upgrading directly from a version earlier than `<4.8`, or when your deployment still contains historical V1 Workflow data. The API defaults to dry-run mode. It scans, converts, and validates the saved structure without writing to the database.
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/v1WorkflowToV2' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"dryRun":true}'
```
After confirming the returned statistics, apply the migration:
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/v1WorkflowToV2' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"dryRun":false}'
```
Skip this step if you already completed the V1 -> V2 migration in an earlier version, or if you are upgrading from v4.8 or later.
#### 6.3 Workflow Dirty-Data Cleanup (required)
This script scans and fixes historical enum-expression strings, nullish values, and legacy-structure compatibility issues in `apps.modules` and `app_versions.nodes`. All self-hosted deployments should run the dry-run first. If the returned statistics show fixable data, apply the write step.
If 6.2 applies to your deployment, run this script after 6.2 completes.
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/initWorkflowData' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"dryRun":true,"batchSize":1000,"writeBatchSize":10}'
```
After confirming the dry-run result, apply the cleanup:
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/initWorkflowData' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"dryRun":false,"batchSize":1000,"writeBatchSize":10}'
```
Lower `writeBatchSize` if production write pressure is high. Documents that fail Zod validation are reported in the response and are not written back to the database.
#### 6.4 Archive Legacy Sandboxes (optional)
If you used legacy sandbox workspaces, this API can fix historical sandbox status fields and optionally archive inactive workspaces to S3. This step does not affect newly generated sandboxes. Skipping it does not block the v4.15 stable upgrade; old workspaces simply will not be archived automatically. You can also delete old sandboxes manually.
Check only, without triggering archive:
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/initSandboxArchive' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"runArchive":false,"inactiveDays":0}'
```
If you use legacy sandbox workspaces, you can archive old sandbox workspaces to S3 with the following API to release inactive sandbox resources more thoroughly. This script only affects old sandboxes and does not affect newly generated sandboxes. You can also remove old sandboxes directly without running this script.
If you want to immediately archive inactive workspaces that match the condition:
```shell
curl --location --request POST 'https://{{host}}/api/admin/initSandboxArchive' \
--header 'rootkey: {{rootkey}}' \
--header 'Content-Type: application/json' \
-d '{"runArchive":true,"inactiveDays":0}'
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/initSandboxArchive' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"runArchive":true,"inactiveDays":0}'
```
## Breaking Changes
## Major Impacts
1. API Key behavior has changed. FastGPT no longer distinguishes between app keys and system keys; only system keys are kept. For OpenAI SDK compatibility, pass the token as `apikey-appId`. Existing API keys remain compatible and continue to work. For details, see the [FastGPT API documentation](../../../openapi/intro).
2. Some APIs now enforce stricter data format validation. If you see a `zod parse error`, please submit an issue. It may be caused by legacy data or custom data structures that do not match the declared schema.
......@@ -112,27 +366,31 @@ curl --location --request POST 'https://{{host}}/api/admin/initSandboxArchive' \
## 🚀 New Features
1. Added the Loop node and deprecated the legacy batch execution node.
2. Added the Skill module. Agent V2 can bind and run static Skills.
3. Reworked the Agent V2 loop logic to improve stability for multi-step tool calls and orchestration.
4. Knowledge Base search now supports native multimodal embedding models, image-to-image search, and permission filtering in Agent mode.
5. Multimodal models now support audio and video input.
6. Added beta support for connecting third-party Knowledge Bases to DingTalk Knowledge Base.
7. Reworked the plugin system architecture, added plugin-level runtime config, and moved system tool execution to local-pool.
8. Reworked the chatbox UI with quick scroll-to-bottom, model-generated chat titles, and smoother streaming output.
9. Added virtual list rendering for apps and Knowledge Bases to improve large-list performance.
10. Added a separate OpenAPI document, distinct from DevAPI documentation.
11. Workflow template export now includes the template name and description.
12. Global variable inputs now support object-type data.
13. In tool call mode, when the virtual machine feature is enabled, files uploaded in the user chat input are injected directly into the VM.
14. Added worker pools for file parsing, HTML-to-Markdown conversion, and text chunking to prevent resource exhaustion under high concurrency.
1. Added the Skill module. Agent V2 can bind and run static Skills.
2. Reworked the Agent V2 loop logic to improve stability for multi-step tool calls and orchestration.
3. Sandbox now supports custom npm and pip sources.
4. Reworked the plugin system architecture, added plugin-level runtime config, and moved system tool execution to local-pool.
5. The commercial edition now supports local direct-connect debugging for FastGPT plugins.
6. Reworked the chatbox UI with quick scroll-to-bottom, model-generated chat titles, and smoother streaming output.
7. Added LLM-generated chat titles.
8. Added the Loop node and deprecated the legacy batch execution node.
9. Knowledge Base search now supports native multimodal embedding models, image-to-image search, and permission filtering in Agent mode.
10. Multimodal models now support audio and video input.
11. API Key logic is optimized. API Key management is unified, and requests now explicitly pass app context.
12. Generated separate DevAPI and System OpenAPI documentation.
13. Added quick-reply output syntax.
14. Added DingTalk Knowledge Base integration for third-party Knowledge Bases.
15. Added model reasoning configuration.
16. S3 now supports CDN configuration.
17. Rerank now supports `defaultConfig`.
18. Share links and portal pages now support language switching and no longer force language detection from the browser.
19. Chat API now validates duplicate `dataId` values to prevent invalid data from entering Workflow execution and stream-resume merge logic.
20. The HTTP node now supports ignoring TLS certificate verification and returning the complete error object.
21. Added a directory depth environment variable to avoid infinitely nested directories.
16. Workflow template export now includes the template name and description.
17. Global variable inputs now support object-type data.
18. In tool call mode, when the virtual machine feature is enabled, files uploaded in the user chat input are injected directly into the VM.
19. Added worker pools for file parsing, HTML-to-Markdown conversion, and text chunking to prevent resource exhaustion under high concurrency.
20. Added a directory depth environment variable to avoid infinitely nested directories. Configure it with `MAX_FOLDER_DEPTH`.
21. S3 now supports CDN configuration.
22. Rerank now supports `defaultConfig`.
23. Share links and portal pages now support language switching and no longer force language detection from the browser.
24. Chat API now validates duplicate `dataId` values to prevent invalid data from entering Workflow execution and stream-resume merge logic.
25. The HTTP node now supports ignoring TLS certificate verification and returning the complete error object.
## ⚙️ Improvements
......@@ -143,8 +401,8 @@ curl --location --request POST 'https://{{host}}/api/admin/initSandboxArchive' \
5. Improved Workflow node name, description input, and long-name adaptation.
6. When the user is redirected from the Workflow editor because the login session expires, the draft is automatically saved for recovery.
7. In Workflow run details, file fields from form input nodes are displayed as file lists.
8. Workflow `nodeResponse` is now stored in a flattened structure to avoid save failures in large nested Workflows.
9. Strengthened validation for Workflow array reference types to avoid conflicts with two-dimensional data.
8. Strengthened validation for Workflow array reference types to avoid conflicts with two-dimensional data.
9. Image processing workers now support configuring whether images are converted to base64 before being sent to the model through `MULTIPLE_DATA_TO_BASE64=true`.
10. HTML output now automatically switches to preview mode after generation, reducing the need to open the preview manually.
11. Improved stream-resume pause and abnormal interruption recovery to reduce chats getting stuck in inaccurate generating or stopping states.
12. The most recent chat is remembered per app when switching apps, and local chat cache is cleared when switching teams.
......@@ -157,18 +415,17 @@ curl --location --request POST 'https://{{host}}/api/admin/initSandboxArchive' \
19. Added validation for input guide configuration to prevent incorrect custom dictionary URL configuration.
20. Strengthened security protection for third-party Knowledge Base requests, HTTP tool parsing, IP detection, and Code Sandbox AST checks.
21. File injection in messages moved from system messages to user messages to improve cache hit rates.
22. Removed `temperature` and `max_tokens` from built-in LLM requests to avoid incompatibility with some models.
23. Improved the reason hide toggle so reasoning can be hidden in the UI while still being preserved when requesting the LLM.
24. Optimized `chat2messages` adaptation to avoid standalone reason output.
25. Empty tool responses are now automatically filled with `none` to avoid errors in some models.
26. Improved the insufficient-balance prompt for non-admin users and visitors.
27. Template features are hidden when the user does not have creation permission.
28. Improved long-name display for apps, Knowledge Bases, files, and folders: names are truncated when they exceed the available width, and the full name is shown on hover.
29. Improved Skill-related modals, editing interactions, and list API performance.
30. Improved the login page UI.
31. Deduplicated site sync rate-limit error prompts.
32. Image processing workers now support configuring whether images are converted to base64 before being sent to the model.
33. LLM request traces now use team-isolated queries to prevent request IDs from exposing request bodies, retrieved Knowledge Base chunks, and model responses across teams.
22. Improved the reason hide toggle so reasoning can be hidden in the UI while still being preserved when requesting the LLM.
23. Optimized `chat2messages` adaptation to avoid standalone reason output.
24. Empty tool responses are now automatically filled with `none` to avoid errors in some models.
25. Improved the insufficient-balance prompt for non-admin users and visitors.
26. Template features are hidden when the user does not have creation permission.
27. Improved long-name display for apps, Knowledge Bases, files, and folders: names are truncated when they exceed the available width, and the full name is shown on hover.
28. Improved Skill-related modals, editing interactions, and list API performance.
29. Improved the login page UI.
30. Deduplicated site sync rate-limit error prompts.
31. Added virtual list rendering for apps and Knowledge Bases to improve large-list performance.
32. LLM request traces now use team-isolated queries to prevent request IDs from exposing request bodies, retrieved Knowledge Base chunks, and model responses across teams.
## 🐛 Bug Fixes
......@@ -186,6 +443,7 @@ curl --location --request POST 'https://{{host}}/api/admin/initSandboxArchive' \
12. Fixed the v1/completions API where `quoteList` in `nodeResponse` did not return `q` and `a`.
13. Fixed conversation stream resume issues, including form restoration, file list restoration, node response preservation, duplicate interaction appending, temporary history titles, and cross-app chat leakage.
14. Stop conversation prompts are now synchronized with the backend generation state, and the warning toast shown during stop has been removed.
15. The v1/chat/completions API previously filtered out `q`/`a`/`index` when returning `nodeResponse`; this version restores those fields.
## 🛠️ Code Improvements
......@@ -203,3 +461,8 @@ curl --location --request POST 'https://{{host}}/api/admin/initSandboxArchive' \
12. Changed the volume manager runtime from Bun to Node.js.
13. Images are now processed promptly inside workers instead of retaining base64 data, reducing memory usage.
14. Added string length protection for system string processing. When strings are too large, synchronized replacement stops to avoid high CPU load.
15. Workflow `nodeResponse` is now stored in a flattened structure to avoid save failures in large nested Workflows.
16. Removed `temperature` and `max_tokens` from all built-in LLM requests to avoid incompatibility with some models.
17. Fixed dirty enum-expression strings such as `FlowNodeInputTypeEnum.*`, `FlowNodeOutputTypeEnum.*`, and `WorkflowIOValueTypeEnum.*` in Workflow node configuration that caused input rendering and IO type checks to behave incorrectly.
18. In Workflow text boxes, `Ctrl+C` for copying text could be intercepted by node copy behavior, preventing text copy.
19. The chat API has been abstracted from app-specific handling into a platform-level capability.
---
title: 'V4.15.0(进行中)'
title: 'V4.15.0'
description: 'FastGPT V4.15.0 更新说明'
---
import { Alert } from '@/components/docs/Alert';
## 📦 升级指南
### 1. 环境变量变更
完整环境变量清单见 [环境变量说明](../../config/env.mdx)。
#### 1.1 fastgpt-app 与 fastgpt-pro
##### 检查是否缺少变量
`fastgpt-app` 和 `fastgpt-pro` 本次升级需关注下面新增或变更语义的配置。同时需检查是否都包含 `AES256_SECRET_KEY` 且相等。
4.15.0 版本引入了更为严格的环境变量检查,升级后需确保以下环境变量正确配置.
```dotenv
# 文件解析 worker 并发数
# 密钥加密密钥,两个服务需一致
AES256_SECRET_KEY=
# 文件 token 密钥,两个服务需一致
FILE_TOKEN_KEY=
# Invoke 反向调用 JWT 密钥,至少 32 位,两个服务需一致
INVOKE_TOKEN_SECRET=
```
##### 新增环境变量
**必须新增的变量**
```dotenv
# SSE mcp server 服务地址,如果不需要 SSE 的话,可以不配置
SSE_MCP_SERVER_PROXY_ENDPOINT=
```
**可选的变量**
以下变量均有默认值,或者不配置不影响使用。
```dotenv
# 文件解析 worker 并发数(可选)
PARSE_FILE_WORKERS=10
# 文件解析超时时间,单位秒
# 文件解析超时时间(秒)(可选)
PARSE_FILE_TIMEOUT_SECONDS=600
# HTML 转 Markdown worker 并发数
# HTML 转 Markdown worker 并发数(可选)
HTML_TO_MARKDOWN_WORKERS=10
# 文本切块 worker 并发数
# 文本切块 worker 并发数(可选)
TEXT_TO_CHUNKS_WORKERS=10
# 自动同步 Mongo 数据库索引,需使用 boolean 字符串值,而不是 0 和 1
# 自动同步 mongo 数据库索引, 改成 boolean 字符串值,而不是 0 和 1(可选)
SYNC_INDEX=true
# 是否启用可信反向代理客户端 IP 校验
# 是否启用可信反向代理客户端 IP 校验(可选)
TRUSTED_PROXY_ENABLE=false
# 可信反向代理 IP/CIDR 列表,逗号或空白分隔。仅 TRUSTED_PROXY_ENABLE=true 时生效
# 可信反向代理 IP/CIDR 列表,逗号或空白分隔。仅 TRUSTED_PROXY_ENABLE=true 时生效;仅显式可信代理传入的 X-Forwarded-For/X-Real-IP 会用于客户端 IP 解析(可选)
TRUSTED_PROXY_IPS=
# 系统变量替换等同步字符串处理的最大字符数,单位 M,范围 1~100
SYSTEM_MAX_STRING_LENGTH_M=100
......@@ -34,66 +60,304 @@ MAX_FOLDER_DEPTH=4
WORKFLOW_MAX_LOOP_TIMES=100
# 并行节点并发上限,最终会 clamp 到 [5, 100]
WORKFLOW_PARALLEL_MAX_CONCURRENCY=10
# Agent 沙箱磁盘大小基准,单位 MB
AGENT_SANDBOX_DISK_MB=1024
# Agent Sandbox 内 npm/yarn/bun 使用的 registry
AGENT_SANDBOX_NPM_REGISTRY=
# Agent Sandbox 内 pip/uv 使用的 Python package index
AGENT_SANDBOX_PYPI_INDEX_URL=
```
#### Plugin 服务
##### 开源版环境变量变更
插件服务升级到 v1.0.0-beta2,系统工具运行方式有较大调整:
开源版移除 config.json 配置文件,改成环境变量,可新增这些变量来替代。移除 volumn 挂载后加入以下变量:
1. 修改 `fastgpt-plugin` 的环境变量 `AUTH_TOKEN`,要求 32 位以上。
2. 同时修改 `fastgpt` 的环境变量 `PLUGIN_TOKEN`,与 `fastgpt-plugin` 的 `AUTH_TOKEN` 一致。
3. 修改 `fastgpt-plugin` 的环境变量 `MONGODB_URI` 中的数据库名,不与 `fastgpt` 的 Mongo 数据库名重名即可,例如:`mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin`
```dotenv
# 自定义 PDF 解析服务地址
CUSTOM_PDF_PARSE_URL=
# 自定义 PDF 解析服务密钥
CUSTOM_PDF_PARSE_KEY=
# Doc2x PDF 解析服务密钥
DOC2X_KEY=
# 合合信息 Textin 服务 App ID
TEXTIN_APP_ID=
# 合合信息 Textin 服务 Secret Code
TEXTIN_SECRET_CODE=
# 向量检索 hnsw ef_search 参数,仅对 PG / OB / OpenGauss 生效
HNSW_EF_SEARCH=100
# 向量检索最大扫描数据量,仅对 PG 生效
HNSW_MAX_SCAN_TUPLES=100000
# 知识库文件解析队列最大并发数
DATASET_PARSE_MAX_PROCESS=10
# 向量训练队列最大并发数
VECTOR_MAX_PROCESS=10
# 问答拆分队列最大并发数
QA_MAX_PROCESS=10
# 图片理解模型处理队列最大并发数
VLM_MAX_PROCESS=10
```
#### 1.2 code-sandbox
#### OpenSandbox
Code Sandbox 新增 `SANDBOX_API_MAX_BODY_MB`、`SANDBOX_MAX_OUTPUT_MB` 等安全相关环境变量,并支持通过 `queueId` 对运行接口做分组排队;完整默认值如下:
如使用 OpenSandbox,`AGENT_SANDBOX_VOLUME_MANAGER_MOUNT_PATH` 不再生效,可移除。OpenSandbox 固定挂载持久化数据到 `/workspace`,旧的沙盒持久化会受到影响。
| 变量 | 默认值 | 说明 |
| --------------------------------- | ------- | ----------------------------------------------------------------- |
| `SANDBOX_API_MAX_BODY_MB` | `8` | `/sandbox` API JSON 请求体总大小上限,包含 `variables`,单位 MB。 |
| `SANDBOX_MAX_OUTPUT_MB` | `10` | 单次代码执行输出 JSON 大小上限,包含返回值和日志,单位 MB。 |
| `CHECK_INTERNAL_IP` | `true` | 沙箱网络请求默认开启内网 IP 检查,降低 SSRF 风险。 |
| `SANDBOX_MAX_TIMEOUT` | `60000` | 单次代码执行超时时间,单位毫秒。 |
| `SANDBOX_MAX_MEMORY_MB` | `256` | 单个沙箱内存上限,单位 MB;运行时会额外预留 `50` MB 开销。 |
| `SANDBOX_POOL_SIZE` | `20` | JS/Python 预热 worker 数量。 |
| `SANDBOX_REQUEST_MAX_COUNT` | `30` | 单次代码执行允许发起的最大网络请求数。 |
| `SANDBOX_REQUEST_TIMEOUT` | `60000` | 沙箱内单次网络请求超时时间,单位毫秒。 |
| `SANDBOX_REQUEST_MAX_RESPONSE_MB` | `10` | 沙箱内单次网络响应体最大大小,单位 MB。 |
| `SANDBOX_REQUEST_MAX_BODY_MB` | `5` | 沙箱内单次网络请求体最大大小,单位 MB。 |
| `SANDBOX_QUEUE_ID_CONCURRENCY` | 空 | 同一个 `queueId` 同时可进入执行流程的请求数;为空时不启用排队。 |
#### Code Sandbox
#### 1.3 fastgpt-plugin
Code Sandbox 新增请求体、输出大小和 `queueId` 排队控制:
插件服务进行了重构,必须增加 `AUTH_TOKEN` 和 `FASTGPT_BASE_URL` 两个环境变量,并且需要修改 `MONGODB_URI` 变量:
1. 修改 `fastgpt-plugin` 的环境变量 `AUTH_TOKEN`,要求 32 位以上。
2. 同时修改 `fastgpt` 和 `fastgpt-pro` 的环境变量 `PLUGIN_TOKEN`,与 `fastgpt-plugin` 的 `AUTH_TOKEN` 一致。
3. 修改 `fastgpt-plugin` 的环境变量 `MONGODB_URI` 中的数据库名,不与 `fastgpt` 的 Mongo 数据库名重名即可,例如:`mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin`
**更多变量,可按需修改**
```dotenv
# /sandbox API JSON 请求体总大小上限,包含 variables,单位 MB
SANDBOX_API_MAX_BODY_MB=8
# 单次代码执行输出 JSON 大小上限,包含返回值和日志,单位 MB
SANDBOX_MAX_OUTPUT_MB=10
# 同一个 queueId 同时可进入执行流程的请求数;为空时不启用排队
SANDBOX_QUEUE_ID_CONCURRENCY=
# ================ 系统 =====================
# 鉴权 token
AUTH_TOKEN=
# 最大 API 请求体大小(MB)
MAX_API_SIZE=10
# FastGPT 服务的地址,可以为内网连接串,用于反向调用 fastgpt 接口。
FASTGPT_BASE_URL=http://fastgpt-app:3000
# ================ 插件运行 =====================
# 可选值: localPool
PLUGIN_RUNTIME_MODE=localPool
# 临时文件存储目录,可以为空
LOCAL_FILE_BASE_PATH=
# ================ 进程池 =====================
# 健康检查时间(ms)
POOL_HEALTH_CHECK_INTERVAL=30000
# 最大总进程数
POOL_MAX_TOTAL_PODS=100
# 某个 Service 的最小进程数
POOL_SERVICE_MIN_PODS=0
# 某个 Service 的最大进程数
POOL_SERVICE_MAX_PODS=5
# 全局空闲超时时间(ms)
POOL_SERVICE_IDLE_TIMEOUT=60000
# 进程运行超时时间(ms)
POOL_SERVICE_POD_TIMEOUT=120000
# 单个进程最大并发请求数
POOL_SERVICE_MAX_CONCURRENT_REQUESTS_PER_POD=10
# 全局单个进程最大请求数,超出后自动轮换
POOL_SERVICE_MAX_REQUESTS_PER_POD=100
# 全局进程队列最大长度
POOL_SERVICE_MAX_QUEUE_SIZE=500
# 全局进程队列超时时间(ms)
POOL_SERVICE_QUEUE_TIMEOUT=60000
# 启动超时退避基础时间(ms)
POOL_SERVICE_STARTUP_RETRY_BASE_DELAY=1000
# 启动超时退避最大时间(ms)
POOL_SERVICE_STARTUP_RETRY_MAX_DELAY=10000
# ================ 数据库 =====================
MONGODB_URI=mongodb://username:password@localhost:27017/fastgpt?authSource=admin&directConnection=true
MONGO_MAX_LINK=20
SYNC_INDEX=true
REDIS_URL=redis://default:password@localhost:6379/0
# ================ 对象存储 =====================
# S3 文件前缀,使用后不可随意修改
S3_FILE_BASE_PATH=system/plugin
STORAGE_VENDOR=minio
STORAGE_REGION=us-east-1
STORAGE_ACCESS_KEY_ID=minioadmin
STORAGE_SECRET_ACCESS_KEY=minioadmin
STORAGE_PUBLIC_BUCKET=fastgpt-public
STORAGE_PRIVATE_BUCKET=fastgpt-private
STORAGE_EXTERNAL_ENDPOINT=http://localhost:9000
STORAGE_S3_ENDPOINT=http://localhost:9000
STORAGE_S3_FORCE_PATH_STYLE=true
STORAGE_S3_MAX_RETRIES=3
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATH=
# ================ 日志 =====================
LOG_ENABLE_CONSOLE=true
# 控制台日志等级: "trace" | "debug" | "info" | "warning" | "error" | "fatal"
LOG_CONSOLE_LEVEL=info
LOG_ENABLE_OTEL=false
# OTEL 存储的最低日志等级
LOG_OTEL_LEVEL=info
LOG_OTEL_SERVICE_NAME=fastgpt-plugin
LOG_OTEL_URL=http://localhost:4318/v1/logs
# ================ 指标 =====================
METRICS_ENABLE_OTEL=false
METRICS_OTEL_SERVICE_NAME=fastgpt-plugin
METRICS_OTEL_URL=http://localhost:4318/v1/metrics
METRICS_EXPORT_INTERVAL_MS=30000
METRICS_EXPORT_TIMEOUT_MS=10000
METRICS_INCLUDE_PLUGIN_VERSION=true
METRICS_INCLUDE_PLUGIN_ETAG=false
METRICS_INCLUDE_HOSTNAME=true
# 多节点部署建议使用 Pod UID / container id / instance id;为空时进程会生成 opaque id。
SERVICE_INSTANCE_ID=
DEPLOYMENT_ENVIRONMENT=
```
`/sandbox/js` 和 `/sandbox/python` 请求体新增可选字段 `queueId`。当配置 `SANDBOX_QUEUE_ID_CONCURRENCY` 且请求传入有效 `queueId` 时,同一 `queueId` 的请求会按 FIFO 排队;不同 `queueId` 或未传 `queueId` 的请求不受该限制,仍只受 worker 池并发限制影响。
### 2. OpenSandbox 调整(按需)
Opensandbox 和其他沙盒提供商的配置单独移动到[沙盒配置](../../config/sandbox/common)内,并不再内置到部署 yml 中。
本次升级主要需修改以下内容:
1. 新部署 `agent-sandbox-proxy` 服务。
2. 更新 `opensandbox` 相关镜像版本。
3. 修改 `fastgpt-app` 和 `fastgpt-pro` 里部分环境变量。
### 3. 镜像变更
### 2. 镜像变更
- 更新 fastgpt-app(fastgpt 主服务) 镜像 tag: v4.15.0
- 更新 fastgpt-pro(fastgpt 商业版) 镜像 tag: v4.15.0
- 更新 fastgpt-code-sandbox 镜像 tag: v4.15.0
- 更新 fastgpt-plugin 镜像 tag: v1.0.0
- 更新 aiproxy 镜像 tag: v0.6.5
### 3. 重装系统工具
如果启用 `opensandbox`,需同步更新下面镜像:
更新 fastgpt-agent-sandbox-proxy 镜像 tag: v0.2.0
更新 fastgpt-agent-sandbox 镜像 tag: v0.2.0
### 4. 启动服务
`docker compose up -d` 重启服务。
### 5. 重装系统工具
插件服务升级后,需要重装旧的所有系统工具:
1. 下载所有系统工具的 [zip 包](<https://github.com/labring/fastgpt-img/raw/refs/heads/main/fastgpt-official-plugins(1).zip>)。
2. 打开 `fastgpt` 网页 - 点击 `管理员` navbar - 点击添加插件 - 点击 `导入/更新插件` - 上传 zip - 确认。
也可以打开插件市场逐个下载,插件市场地址为: [https://v2.marketplace.fastgpt.cn](https://v2.marketplace.fastgpt.cn),环境变量默认值已变成该地址,不设置环境变量即可。
也可以打开插件市场逐个下载安装,插件市场地址为: [https://v2.marketplace.fastgpt.cn](https://v2.marketplace.fastgpt.cn),环境变量默认值已变成该地址,不设置相关环境变量即可。
### 6. 执行迁移脚本
执行前先完成三件事:
1. 备份 MongoDB、对象存储和当前部署配置。
2. 将 `fastgpt-app` / `fastgpt-pro` 升级到包含这些 Root 管理员接口的镜像版本。
3. 准备可访问 FastGPT 的 `{{host}}` 和 `{{rootkey}}`。下面所有接口都需要 `rootkey`。
#### 6.1 清理重复的 appId-chatId(可选,但建议执行)
### 4. 升级脚本
正式版会同步 `{ appId, chatId }` 和 `{ sourceType, appId, chatId }` 两个唯一索引。正式版索引最终同步成功前,必须检查并清理 `chats` 集合中重复的 `appId + chatId`;否则开启 `SYNC_INDEX=true` 后,索引同步可能报 `E11000 duplicate key error`,唯一约束不会生效。
如使用旧版沙盒 workspace,可通过下面接口将旧沙盒 workspace 归档到 S3,从而更彻底地释放不活跃沙盒。该脚本仅影响旧的沙盒,不影响新生成的沙盒;不执行该脚本,直接移除旧沙盒也可以。
该接口依赖升级后的 `fastgpt-app` 镜像。如果首次启动正式版时已经出现唯一索引冲突,但服务仍可访问,可直接执行下面的 dry-run 和清理命令,完成后重启服务重新同步索引。
```shell
curl --location --request POST 'https://{{host}}/api/admin/dataClean/initSandboxArchive' \
--header 'rootkey: {{rootkey}}' \
--header 'Content-Type: application/json' \
-d '{"runArchive":true,"inactiveDays":0}'
先执行 dry-run。该步骤不会删除数据,所有环境都应至少执行一次:
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/cleanupDuplicateChats' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"dryRun":true,"sampleLimit":20}'
```
重点查看返回值:
- `duplicateDocumentCount`:预计需要删除的重复 `chats` 会话头数量。
- `samples`:重复样本,包含保留的 `keepId` 和候选删除的 `deleteIds`。
- `deletedDocumentCount`:正式执行时实际删除数量,dry-run 时固定为 `0`。
如果 `duplicateDocumentCount=0`,无需执行正式清理。如果大于 0,确认样本无误后执行:
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/cleanupDuplicateChats' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"dryRun":false,"sampleLimit":20}'
```
清理策略:每组重复的 `appId + chatId` 会保留 `updateTime` 最新的一条;如果时间相同,用 `_id` 倒序作为稳定兜底。接口只删除重复的 `chats` 会话头,不删除 `chatitems`、`chat_item_responses` 中的消息内容。
清理完成后,保持 `SYNC_INDEX=true` 并重启 `fastgpt-app` / `fastgpt-pro`,让服务重新同步索引。可进入 MongoDB 后确认两个索引都已经是 `unique: true`:
```js
db.chats
.getIndexes()
.filter((idx) => ['appId_1_chatId_1', 'sourceType_1_appId_1_chatId_1'].includes(idx.name));
```
#### 6.2 Workflow V1 -> V2 迁移(可选)
只有从 `<4.8` 的旧版本直接升级,或历史上仍保留 V1 Workflow 数据的环境需要执行。该接口默认 dry-run,会扫描、转换并校验保存结构,但不写库。
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/v1WorkflowToV2' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"dryRun":true}'
```
确认返回统计后,执行正式迁移:
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/v1WorkflowToV2' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"dryRun":false}'
```
### 清理重复对话,构建唯一索引
如果你已经在较早版本完成过 V1 -> V2 迁移,或从 v4.8 及以上版本升级,可跳过本步骤。
#### 6.3 Workflow 脏数据清理(必须)
该脚本会扫描并修复 `apps.modules` 和 `app_versions.nodes` 中历史枚举表达式字符串、空值和旧结构兼容问题。所有自托管环境都应先执行 dry-run;如果返回统计显示存在可修复数据,再执行正式写入。
如果满足 6.2 条件,该脚本必须在 6.2 之后执行。
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/initWorkflowData' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"dryRun":true,"batchSize":1000,"writeBatchSize":10}'
```
确认 dry-run 结果后执行:
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/initWorkflowData' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"dryRun":false,"batchSize":1000,"writeBatchSize":10}'
```
生产写入压力较高时,可以降低 `writeBatchSize`。未通过 Zod 校验的文档只会在响应中报告,不会被写回数据库。
#### 6.4 归档旧沙盒(可选)
如果使用过旧版 sandbox workspace,可通过该接口修正历史 sandbox 状态字段,并按需把不活跃 workspace 归档到 S3。该步骤不影响新生成的 sandbox;不执行也不影响 v4.15 正式版升级,只是不会自动归档旧 workspace。可以手动删除旧的沙盒。
只检查、不触发归档:
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/initSandboxArchive' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"runArchive":false,"inactiveDays":0}'
```
如果确认需要立即归档满足条件的不活跃 workspace:
```bash
curl -X POST 'https://{{host}}/api/admin/dataClean/initSandboxArchive' \
-H 'Content-Type: application/json' \
-H 'rootkey: {{rootkey}}' \
-d '{"runArchive":true,"inactiveDays":0}'
```
## 功能重大变化
## 一些大的影响
1. ApiKey 功能调整,不再区分应用 key 和系统 key,只保留系统 key,如需兼容 openai sdk 用法,可使用 `apikey-appId` 的方式传递 Token。已有的 apikey 保持兼容,不影响使用。具体和查阅 [FastGPT API 文档说明](../../../openapi/intro)
2. 部分 API 增加了更为严格的数据格式校验,如过遇到报错: `zod parse error` 可提交 issue 反馈,可能因一些旧数据或者自定义数据结构与声明不一致。
......@@ -103,26 +367,29 @@ curl --location --request POST 'https://{{host}}/api/admin/dataClean/initSandbox
1. 新增技能模块,Agent V2 可绑定静态 Skill 来运行。
2. 重写 Agent V2 loop 逻辑,提升多轮工具调用和流程编排的稳定性。
3. 插件系统架构重写,支持插件级 runtime config,系统工具运行迁移到 local-pool。
4. 重写 chatbox UI,支持快速滚动到底部、模型生成对话标题和更流畅的流式输出动效。
5. 新增循环节点,弃用旧的批量执行。
6. 知识库搜索支持原生多模态 embedding 模型、图搜图和 Agent 模式权限过滤。
7. 多模态模型支持音视频输入。
8. API 密钥逻辑优化,统一 APIKey 管理并由请求显式传入应用上下文。
9. 生成 DevAPI 和 System OpenAPI 两套 API 文档。
10. 支持快速回复的输出语法。
11. 第三方知识库新增钉钉知识库接入。
12. 增加模型思考配置。
13. 工作流模板导出支持同时导出名称和介绍。
14. 全局变量输入框支持输入 object 类型数据。
15. 工具调用模式下,如果开启虚拟机功能,用户对话框上传的文件会直接注入到虚拟机中。
16. 增加文件解析、HTML 转 Markdown、文本切块 worker pool,避免并发太高导致资源耗尽。
17. 支持目录深度环境变量,避免无限嵌套目录。可配置环境变量 `MAX_FOLDER_DEPTH`。
18. S3 支持配置 CDN。
19. Rerank 支持配置 defaultConfig。
20. 分享链接/门户页支持语言切换,不再强制自动识别浏览器语言。
21. Chat API 增加 `dataId` 重复校验,避免脏数据进入工作流与流恢复合并逻辑。
22. HTTP 节点支持配置忽略 TLS 证书校验,并支持返回完整错误对象。
3. 沙盒支持自定义 npm 和 pip 源。
4. 插件系统架构重写,支持插件级 runtime config,系统工具运行迁移到 local-pool。
5. 商业版支持本地直连 FastGPT 调试插件。
6. 重写 chatbox UI,支持快速滚动到底部、模型生成对话标题和更流畅的流式输出动效。
7. 支持通过 LLM 生成对话标题。
8. 新增循环节点,弃用旧的批量执行。
9. 知识库搜索支持原生多模态 embedding 模型、图搜图和 Agent 模式权限过滤。
10. 多模态模型支持音视频输入。
11. API 密钥逻辑优化,统一 APIKey 管理并由请求显式传入应用上下文。
12. 生成 DevAPI 和 System OpenAPI 两套 API 文档。
13. 支持快速回复的输出语法。
14. 第三方知识库新增钉钉知识库接入。
15. 增加模型思考配置。
16. 工作流模板导出支持同时导出名称和介绍。
17. 全局变量输入框支持输入 object 类型数据。
18. 工具调用模式下,如果开启虚拟机功能,用户对话框上传的文件会直接注入到虚拟机中。
19. 增加文件解析、HTML 转 Markdown、文本切块 worker pool,避免并发太高导致资源耗尽。
20. 支持目录深度环境变量,避免无限嵌套目录。可配置环境变量 `MAX_FOLDER_DEPTH`。
21. S3 支持配置 CDN。
22. Rerank 支持配置 defaultConfig。
23. 分享链接/门户页支持语言切换,不再强制自动识别浏览器语言。
24. Chat API 增加 `dataId` 重复校验,避免脏数据进入工作流与流恢复合并逻辑。
25. HTTP 节点支持配置忽略 TLS 证书校验,并支持返回完整错误对象。
## ⚙️ 优化
......@@ -175,6 +442,7 @@ curl --location --request POST 'https://{{host}}/api/admin/dataClean/initSandbox
12. 修复 v1/completions 接口 `nodeResponse` 中 `quoteList` 未返回 `q`、`a` 的问题。
13. 修复对话流恢复过程中的表单回填、文件列表恢复、节点响应保留、重复交互追加、临时历史标题和跨应用会话串显问题。
14. 停止会话提示改为与后端生成态同步,移除停止时的 warning toast。
15. v1/chat/completions 接口,返回 nodeResponse 时候,过滤掉了 q/a/index,该版本恢复返回。
## 🛠️ 代码优化
......@@ -194,3 +462,6 @@ curl --location --request POST 'https://{{host}}/api/admin/dataClean/initSandbox
14. 增加系统处理字符串时的长度保护,如果长度过大会停止继续同步替换,避免高 CPU 负载。
15. 工作流运行的 nodeResponse 改为扁平化存储,避免大的嵌套工作流保存失败。
16. 移除所有内置 LLM 请求中的 `temperature` 和 `max_tokens`,避免部分模型不兼容。
17. 修复工作流节点配置中 `FlowNodeInputTypeEnum.*`、`FlowNodeOutputTypeEnum.*` 和 `WorkflowIOValueTypeEnum.*` 枚举表达式字符串脏数据导致输入渲染和 IO 类型判断异常的问题。
18. 工作流文本框,ctrl+c 复制文本内容时,会被节点复制抢占,导致无法复制文本。
19. chat 接口抽象,不再绑定 app, 改成平台级别通用。
......@@ -29,8 +29,6 @@ Code Sandbox adds security-related environment variables such as `SANDBOX_API_MA
| `SANDBOX_REQUEST_MAX_BODY_MB` | `5` | Maximum request body size for one sandbox network request, in MB. |
| `SANDBOX_QUEUE_ID_CONCURRENCY` | Empty | Number of requests with the same `queueId` that may enter execution at once. Empty disables queueing. |
`/sandbox/js` and `/sandbox/python` request bodies now support an optional `queueId` field. When `SANDBOX_QUEUE_ID_CONCURRENCY` is configured and a valid `queueId` is provided, requests with the same `queueId` are queued in FIFO order. Requests with different `queueId` values, or requests without `queueId`, are not limited by this setting and continue to be limited only by the worker pool concurrency.
## 🚀 New Features
1. Multimodal models now support audio and video input.
......
......@@ -29,8 +29,6 @@ Code Sandbox 新增 `SANDBOX_API_MAX_BODY_MB`、`SANDBOX_MAX_OUTPUT_MB` 等安
| `SANDBOX_REQUEST_MAX_BODY_MB` | `5` | 沙箱内单次网络请求体最大大小,单位 MB。 |
| `SANDBOX_QUEUE_ID_CONCURRENCY` | 空 | 同一个 `queueId` 同时可进入执行流程的请求数;为空时不启用排队。 |
`/sandbox/js` 和 `/sandbox/python` 请求体新增可选字段 `queueId`。当配置 `SANDBOX_QUEUE_ID_CONCURRENCY` 且请求传入有效 `queueId` 时,同一 `queueId` 的请求会按 FIFO 排队;不同 `queueId` 或未传 `queueId` 的请求不受该限制,仍只受 worker 池并发限制影响。
## 🚀 新增内容
1. 多模态模型支持音视频输入。
......
......@@ -100,4 +100,4 @@ Risk: trace records written before this upgrade do not have `teamId`, so they ca
## Code Improvements
1. The chat takeover API has been abstracted from app-specific handling into a platform-level capability.
1. The chat API has been abstracted from app-specific handling into a platform-level capability.
......@@ -106,4 +106,4 @@ LLM 请求追踪记录(`llm_request_records`)新增 `teamId` 字段,`GET /
## 代码优化
1. chat 接管接口抽象,不再绑定 app, 改成平台级别通用。
1. chat 接口抽象,不再绑定 app, 改成平台级别通用。
......@@ -35,7 +35,7 @@ CREATE INDEX CONCURRENTLY vector_index ON modeldata USING hnsw (vector vector_ip
```
| | |
| -------------------- | -------------------- |
| -------------------------------------- | -------------------------------------- |
| ![](../../../../public/imgs/v45-1.jpg) | ![](../../../../public/imgs/v45-2.jpg) |
| ![](../../../../public/imgs/v45-3.jpg) | ![](../../../../public/imgs/v45-4.jpg) |
......@@ -84,4 +84,4 @@ CREATE INDEX CONCURRENTLY vector_index ON modeldata USING hnsw (vector vector_ip
## Configuration File Changes Required
For the latest configuration, refer to: [V4.5 Latest config.json](../../config/json.en.mdx)
The legacy `config.json` guide is no longer maintained. For current versions, see [Model Configuration](../../config/model/intro.en.mdx).
......@@ -3,13 +3,13 @@ title: V4.5(需进行较为复杂更新)
description: FastGPT V4.5 更新
---
FastGPT V4.5 引入 PgVector0.5 版本的 HNSW 索引,极大的提高了知识库检索的速度,比起`IVFFlat`索引大致有3~10倍的性能提升,可轻松实现百万数据毫秒级搜索。缺点在于构建索引的速度非常慢,4c16g 500w 组数据使用`并行构建`大约花了 48 小时。具体参数配置可参考 [PgVector官方](https://github.com/pgvector/pgvector)
FastGPT V4.5 引入 PgVector0.5 版本的 HNSW 索引,极大的提高了知识库检索的速度,比起 `IVFFlat` 索引大致有 3~10 倍的性能提升,可轻松实现百万数据毫秒级搜索。缺点在于构建索引的速度非常慢,4c16g 500w 组数据使用 `并行构建` 大约花了 48 小时。具体参数配置可参考 [PgVector 官方](https://github.com/pgvector/pgvector)
下面需要对数据库进行一些操作升级:
## PgVector升级:Sealos 部署方案
## PgVector 升级:Sealos 部署方案
1. 点击[Sealos桌面](https://cloud.sealos.io?uid=fnWRt09fZP)的数据库应用。
1. 点击 [Sealos 桌面](https://cloud.sealos.io?uid=fnWRt09fZP)的数据库应用。
2. 点击【pg】数据库的详情。
3. 点击右上角的重启,等待重启完成。
4. 点击左侧的一键链接,等待打开 Terminal。
......@@ -35,15 +35,15 @@ CREATE INDEX CONCURRENTLY vector_index ON modeldata USING hnsw (vector vector_ip
```
| | |
| -------------------- | -------------------- |
| -------------------------------------- | -------------------------------------- |
| ![](../../../../public/imgs/v45-1.jpg) | ![](../../../../public/imgs/v45-2.jpg) |
| ![](../../../../public/imgs/v45-3.jpg) | ![](../../../../public/imgs/v45-4.jpg) |
## PgVector升级:Docker-compose.yml 部署方案
## PgVector 升级:Docker-compose.yml 部署方案
下面的命令是基于给的 docker-compose 模板,如果数据库账号密码更换了,请自行调整。
1. 修改 `docker-compose.yml` 中pg的镜像版本,改成 `ankane/pgvector:v0.5.0` 或 `registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.5.0`
1. 修改 `docker-compose.yml` 中 pg 的镜像版本,改成 `ankane/pgvector:v0.5.0` 或 `registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.5.0`
2. 重启 pg 容器(docker-compose pull && docker-compose up -d),等待重启完成。
3. 进入容器: `docker exec -it pg bash`
4. 连接数据库: `psql 'postgresql://username:password@localhost:5432/postgres'`
......@@ -76,7 +76,7 @@ CREATE INDEX CONCURRENTLY vector_index ON modeldata USING hnsw (vector vector_ip
### Fast GPT V4.5
1. 新增 - 升级 PgVector 插件,引入 HNSW 索引,极大加快的知识库搜索速度。
2. 新增 - AI对话模块,增加【返回AI内容】选项,可控制 AI 的内容不直接返回浏览器。
2. 新增 - AI 对话模块,增加【返回 AI 内容】选项,可控制 AI 的内容不直接返回浏览器。
3. 新增 - 支持问题分类选择模型
4. 优化 - TextSplitter,采用递归拆解法。
5. 优化 - 高级编排 UX 性能
......@@ -84,4 +84,4 @@ CREATE INDEX CONCURRENTLY vector_index ON modeldata USING hnsw (vector vector_ip
## 该版本需要修改 `config.json` 文件
最新配置可参考: [V45版本最新 config.json](../../config/json.mdx)
旧版 `config.json` 配置说明已不再维护,当前版本请参考[模型配置方案](../../config/model/intro.mdx)。
......@@ -9,7 +9,7 @@ description: FastGPT V4.6 Update
Update the image to the latest or V4.6 version. For the commercial edition, update to V0.2.1.
For the latest configuration, refer to: [V4.6 Latest config.json](../../config/json.en.mdx). The commercial edition configuration file has also been updated — refer to the latest Lark documentation.
The legacy `config.json` guide is no longer maintained. For current versions, see [Model Configuration](../../config/model/intro.en.mdx) and [Environment Variables](../../config/env.en.mdx). The commercial edition configuration file has also been updated — refer to the latest Lark documentation.
## 2. Run the Initialization APIs
......@@ -34,6 +34,7 @@ curl --location --request POST 'https://{{host}}/api/admin/initv46-2' \
```
What the initialization does:
1. Creates the default team.
2. Initializes team fields for all resources in Mongo.
3. Initializes PG fields.
......
......@@ -9,11 +9,11 @@ description: FastGPT V4.6 更新
更新镜像至 latest 或者 v4.6 版本。商业版镜像更新至 V0.2.1
最新配置可参考:[V46 版本最新 config.json](../../config/json.mdx),商业镜像配置文件也更新,参考最新的飞书文档。
旧版 `config.json` 配置说明已不再维护,当前版本请参考[模型配置方案](../../config/model/intro.mdx)和[环境变量说明](../../config/env.mdx),商业镜像配置文件也更新,参考最新的飞书文档。
## 2。执行初始化 API
发起 2 个 HTTP 请求 (`{{rootkey}}` 替换成环境变量里的 `rootkey`,`{{host}}` 替换成自己域名)
发起 2 个 HTTP 请求 ( `{{rootkey}}` 替换成环境变量里的 `rootkey`,`{{host}}` 替换成自己域名)
**该初始化接口可能速度很慢,返回超时不用管,注意看日志即可,需要注意的是,需确保 initv46 成功后,在执行 initv46-2**
......@@ -33,8 +33,7 @@ curl --location --request POST 'https://{{host}}/api/admin/initv46-2' \
--header 'Content-Type: application/json'
```
初始化内容:
1。创建默认团队
初始化内容:1。创建默认团队
2。初始化 Mongo 所有资源的团队字段
3。初始化 Pg 的字段
4。初始化 Mongo Data
......
......@@ -7,7 +7,7 @@ description: FastGPT V4.6.5
Since OpenAI has begun deprecating function calls in favor of tool choice, FastGPT has updated its configuration and invocation methods accordingly. You'll need to make some changes to your configuration file:
[View the latest configuration file](../../config/json.en.mdx)
The legacy `config.json` guide is no longer maintained. For current versions, see [Model Configuration](../../config/model/intro.en.mdx).
1. The main change is renaming the `functionCall` field to `toolChoice` in your model configuration. Models with this set to `true` will use OpenAI's tools mode by default; models without it or with it set to `false` will use prompt-based generation.
......
......@@ -7,9 +7,9 @@ description: FastGPT V4.6.5
由于 openai 已开始弃用 function call,改为 toolChoice。FastGPT 同步的修改了对于的配置和调用方式,需要对配置文件做一些修改:
[点击查看最新的配置文件](../../config/json.mdx)
旧版 `config.json` 配置说明已不再维护,当前版本请参考[模型配置方案](../../config/model/intro.mdx)。
1. 主要是修改模型的`functionCall`字段,改成`toolChoice`即可。设置为`true`的模型,会默认走 openai 的 tools 模式;未设置或设置为`false`的,会走提示词生成模式。
1. 主要是修改模型的 `functionCall` 字段,改成 `toolChoice` 即可。设置为 `true` 的模型,会默认走 openai 的 tools 模式;未设置或设置为 `false` 的,会走提示词生成模式。
问题优化模型与内容提取模型使用同一组配置。
......@@ -21,8 +21,8 @@ description: FastGPT V4.6.5
2. 新增 - [文本编辑模块](../../../guide/build/workflow/nodes/text_editor.mdx)
3. 新增 - [判断器模块](../../../guide/build/workflow/nodes/tfswitch.mdx)
4. 新增 - [自定义反馈模块](../../../guide/build/workflow/nodes/custom_feedback.mdx)
5. 新增 - 【内容提取】模块支持选择模型,以及字段枚举
6. 优化 - docx读取,兼容表格(表格转markdown)
5. 新增 -【内容提取】模块支持选择模型,以及字段枚举
6. 优化 - docx 读取,兼容表格(表格转 markdown)
7. 优化 - 高级编排连接线交互
8. 优化 - 由于 html2md 导致的 cpu密集计算,阻断线程问题
8. 优化 - 由于 html2md 导致的 cpu 密集计算,阻断线程问题
9. 修复 - 高级编排提示词提取描述
......@@ -5,7 +5,7 @@ description: FastGPT V4.6.6
## Configuration Changes
To reduce code duplication, we've made some changes to the configuration file: [View the latest configuration file](../../config/json.en.mdx)
To reduce code duplication, we've made some changes to the configuration file. The legacy `config.json` guide is no longer maintained. For current versions, see [Model Configuration](../../config/model/intro.en.mdx) and [Environment Variables](../../config/env.en.mdx).
## Commercial Edition Changes
......
......@@ -5,15 +5,15 @@ description: FastGPT V4.6.6
## 配置文件变更
为了减少代码重复度,我们对配置文件做了一些修改:[点击查看最新的配置文件](../../config/json.mdx)
为了减少代码重复度,我们对配置文件做了一些修改。旧版 `config.json` 配置说明已不再维护,当前版本请参考[模型配置方案](../../config/model/intro.mdx)和[环境变量说明](../../config/env.mdx)。
## 商业版变更
1. 更新商业版镜像到 4.6.6 版本。
2. 将旧版配置文件中的 `SystemParams.pluginBaseUrl` 放置到环境变量中:
PRO_URL=商业版镜像地址(此处不再需要以 /api 结尾),例如:
PRO_URL=http://fastgpt-plugin.ns-hsss5d.svc.cluster.local:3000
PRO_URL=商业版镜像地址(此处不再需要以 /API 结尾),例如:
PRO_URL= http://fastgpt-plugin.ns-hsss5d.svc.cluster.local:3000
3. 原本在配置文件中的 `FeConfig` 已被移除,可以直接打开新的商业版镜像外网地址进行配置。包括 FastGPT 的各个参数和模型都可以直接在商业版镜像中配置,无需再变更 `config.json` 文件。
......@@ -21,9 +21,9 @@ description: FastGPT V4.6.6
1. 查看 [FastGPT 2024 RoadMap](https://github.com/labring/FastGPT?tab=readme-ov-file#-%E5%9C%A8%E7%BA%BF%E4%BD%BF%E7%94%A8)
2. 新增 - Http 模块请求头支持 Json 编辑器。
3. 新增 - [ReRank模型部署](../../custom-models/bge-rerank.mdx)
3. 新增 - [ReRank 模型部署](../../custom-models/bge-rerank.mdx)
4. 新增 - 搜索方式:分离向量语义检索,全文检索和重排,通过 RRF 进行排序合并。
5. 优化 - 问题分类提示词,id引导。测试国产商用 api 模型(百度阿里智谱讯飞)使用 Prompt 模式均可分类。
6. UI 优化,未来将逐步替换新的UI设计。
5. 优化 - 问题分类提示词,ID 引导。测试国产商用 API 模型(百度阿里智谱讯飞)使用 Prompt 模式均可分类。
6. UI 优化,未来将逐步替换新的 UI 设计。
7. 优化代码:Icon 抽离和自动化获取。
8. 修复 - 链接读取的数据集,未保存选择器,导致同步时不使用选择器。
......@@ -67,7 +67,7 @@ docker-compose up -d
## Update Configuration File
Removed duplicate model configurations. All LLM models are now consolidated into a single property. [View the latest configuration file](../../config/json.en.mdx)
Removed duplicate model configurations. All LLM models are now consolidated into a single property. The legacy `config.json` guide is no longer maintained. For current versions, see [Model Configuration](../../config/model/intro.en.mdx).
## Commercial Edition Initialization
......
......@@ -5,7 +5,7 @@ description: FastGPT V4.6.8更新说明
## docker 部署 - 手动更新 Mongo
1. 修改 docker-compose.yml 的mongo部分,补上`command`和`entrypoint`
1. 修改 docker-compose.yml 的 mongo 部分,补上 `command` 和 `entrypoint`
```yml
mongo:
......@@ -67,13 +67,13 @@ docker-compose up -d
## 修改配置文件
去除了重复的模型配置,LLM模型都合并到一个属性中:[点击查看最新的配置文件](../../config/json.mdx)
去除了重复的模型配置,LLM 模型都合并到一个属性中。旧版 `config.json` 配置说明已不再维护,当前版本请参考[模型配置方案](../../config/model/intro.mdx)。
## 商业版初始化
商业版用户需要执行一个初始化,格式化团队信息。
发起 1 个 HTTP 请求 (`{{rootkey}}` 替换成环境变量里的 `rootkey`,`{{host}}` 替换成商业版域名)
发起 1 个 HTTP 请求 ( `{{rootkey}}` 替换成环境变量里的 `rootkey`,`{{host}}` 替换成商业版域名)
```bash
curl --location --request POST 'https://{{host}}/api/init/v468' \
......@@ -87,8 +87,8 @@ curl --location --request POST 'https://{{host}}/api/init/v468' \
1. 新增 - 知识库搜索合并模块。
2. 新增 - 新的 Http 模块,支持更加灵活的参数传入。同时支持了输入输出自动数据类型转化,例如:接口输出的 JSON 类型会自动转成字符串类型,直接给其他模块使用。此外,还补充了一些例子,可在文档中查看。
3. 优化 - 内容补全。将内容补全内置到【知识库搜索】中,并实现了一次内容补全,即可完成“指代消除”和“问题扩展”。FastGPT知识库搜索详细流程可查看:[知识库搜索介绍](../../../guide/build/workflow/nodes/dataset_search.mdx)
4. 优化 - LLM 模型配置,不再区分对话、分类、提取模型。同时支持模型的默认参数,避免不同模型参数冲突,可通过`defaultConfig`传入默认的配置。
5. 优化 - 流响应,参考了`ChatNextWeb`的流,更加丝滑。此外,之前提到的乱码、中断,刷新后又正常了,可能会修复)
3. 优化 - 内容补全。将内容补全内置到【知识库搜索】中,并实现了一次内容补全,即可完成“指代消除”和“问题扩展”。FastGPT 知识库搜索详细流程可查看:[知识库搜索介绍](../../../guide/build/workflow/nodes/dataset_search.mdx)
4. 优化 - LLM 模型配置,不再区分对话、分类、提取模型。同时支持模型的默认参数,避免不同模型参数冲突,可通过 `defaultConfig` 传入默认的配置。
5. 优化 - 流响应,参考了 `ChatNextWeb` 的流,更加丝滑。此外,之前提到的乱码、中断,刷新后又正常了,可能会修复。
6. 修复 - 语音输入文件无法上传。
7. 修复 - 对话框重新生成无法使用。
......@@ -5,7 +5,7 @@ description: FastGPT V4.7 Release Notes
## 1. Update Configuration File
Added Boolean values to control which models are available for different feature modules, and added model logos. [View the latest configuration file](../../config/json.en.mdx)
Added Boolean values to control which models are available for different feature modules, and added model logos. The legacy `config.json` guide is no longer maintained. For current versions, see [Model Configuration](../../config/model/intro.en.mdx).
## 2. Initialization Script
......
......@@ -5,7 +5,7 @@ description: FastGPT V4.7更新说明
## 1. 修改配置文件
增加一些 Boolean 值,用于决定不同功能块可以使用哪些模型,同时增加了模型的 logo:[点击查看最新的配置文件](../../config/json.mdx)
增加一些 Boolean 值,用于决定不同功能块可以使用哪些模型,同时增加了模型的 logo。旧版 `config.json` 配置说明已不再维护,当前版本请参考[模型配置方案](../../config/model/intro.mdx)。
## 2. 初始化脚本
......@@ -23,9 +23,9 @@ curl --location --request POST 'https://{{host}}/api/admin/initv47' \
## 3. 升级 ReRank 模型
4.7对ReRank模型进行了格式变动,兼容 cohere 的格式,可以直接使用 cohere 提供的 API。如果是本地的 ReRank 模型,需要修改镜像为:`registry.cn-hangzhou.aliyuncs.com/fastgpt/bge-rerank-base:v0.1` 。
4.7 对 ReRank 模型进行了格式变动,兼容 cohere 的格式,可以直接使用 cohere 提供的 API。如果是本地的 ReRank 模型,需要修改镜像为:`registry.cn-hangzhou.aliyuncs.com/fastgpt/bge-rerank-base:v0.1`。
cohere的重排模型对中文不是很好,感觉不如 bge 的好用,接入教程如下:
cohere 的重排模型对中文不是很好,感觉不如 bge 的好用,接入教程如下:
1. 申请 Cohere 官方 Key: https://dashboard.cohere.com/api-keys
2. 修改 FastGPT 配置文件
......@@ -45,22 +45,22 @@ cohere的重排模型对中文不是很好,感觉不如 bge 的好用,接入
## V4.7 更新说明
1. 新增 - 工具调用模块,可以让LLM模型根据用户意图,动态的选择其他模型或插件执行。
2. 新增 - 分类和内容提取支持 functionCall 模式。部分模型支持 functionCall 不支持 ToolCall,也可以使用了。需要把 LLM 模型配置文件里的 `functionCall` 设置为 `true`, `toolChoice`设置为 `false`。如果 `toolChoice` 为 true,会走 tool 模式。
3. 新增 - HTTP插件,可实现OpenAPI快速生成插件。
4. 新增 - Rerank 模型兼容 [cohere的格式](https://docs.cohere.com/reference/rerank-1),可以直接使用 cohere 的 rerank 模型。
1. 新增 - 工具调用模块,可以让 LLM 模型根据用户意图,动态的选择其他模型或插件执行。
2. 新增 - 分类和内容提取支持 functionCall 模式。部分模型支持 functionCall 不支持 ToolCall,也可以使用了。需要把 LLM 模型配置文件里的 `functionCall` 设置为 `true`,`toolChoice` 设置为 `false`。如果 `toolChoice` 为 true,会走 tool 模式。
3. 新增 - HTTP 插件,可实现 OpenAPI 快速生成插件。
4. 新增 - Rerank 模型兼容 [cohere 的格式](https://docs.cohere.com/reference/rerank-1),可以直接使用 cohere 的 rerank 模型。
5. 新增 - Helm 安装。
6. 优化 - 高级编排性能。
7. 优化 - 抽离 Flow controller 到 packages。
8. 优化 - AI模型选择。
8. 优化 - AI 模型选择。
9. 优化 - 手动输入知识库弹窗。
10. 优化 - 变量输入弹窗。
11. 优化 - docker 部署,自动初始化副本集。
12. 优化 - 浏览器读取文件自动推断编码,减少乱码情况。
13. 修复 - 社区版重排选不上。
14. 修复 - http 请求 body,不使用时,传入undefined。(会造成部分GET请求失败)
15. 新增 - 支持 http url 使用变量。
14. 修复 - http 请求 body,不使用时,传入 undefined。(会造成部分 GET 请求失败)
15. 新增 - 支持 http URL 使用变量。
16. 修复 - 469 的提取的提示词容易造成幻觉。
17. 修复 - PG HNSW索引未实际生效问题,本次更新后,搜索速度大幅度提升(但是可能会出现精度损失,如果出现精度损失需要参考PgVector文档,对索引进行调整)。详细见:https://github.com/pgvector/pgvector?tab=readme-ov-file#troubleshooting
18. 修复Safari浏览器语音输入问题。
17. 修复 - PG HNSW 索引未实际生效问题,本次更新后,搜索速度大幅度提升(但是可能会出现精度损失,如果出现精度损失需要参考 PgVector 文档,对索引进行调整)。详细见:https://github.com/pgvector/pgvector?tab=readme-ov-file#troubleshooting
18. 修复 Safari 浏览器语音输入问题。
19. 修复 - 自定义分割规则可输入正则特殊字符(之前输入的话,会导致前端崩溃)
......@@ -17,7 +17,7 @@ This request runs stale data cleanup (removes invalid files, images, Knowledge B
## Update Configuration File
Added Laf environment configuration. [View the latest configuration file](../../config/json.en.mdx)
Added Laf environment configuration. The legacy `config.json` guide is no longer maintained. For current versions, see [Environment Variables](../../config/env.en.mdx).
## V4.7.1 Release Notes
......
......@@ -5,7 +5,7 @@ description: FastGPT V4.7.1 更新说明
## 初始化脚本
从任意终端,发起 1 个 HTTP 请求。其中 `{{rootkey}}` 替换成环境变量里的 `rootkey`;`{{host}}` 替换成FastGPT的域名。
从任意终端,发起 1 个 HTTP 请求。其中 `{{rootkey}}` 替换成环境变量里的 `rootkey`;`{{host}}` 替换成 FastGPT 的域名。
```bash
curl --location --request POST 'https://{{host}}/api/admin/clearInvalidData' \
......@@ -17,19 +17,19 @@ curl --location --request POST 'https://{{host}}/api/admin/clearInvalidData' \
## 修改配置文件
增加了Laf环境配置:[点击查看最新的配置文件](../../config/json.mdx)
增加了 Laf 环境配置。旧版 `config.json` 配置说明已不再维护,当前版本请参考[环境变量说明](../../config/env.mdx)。
## V4.7.1 更新说明
1. 新增 - 语音输入完整配置。支持选择是否打开语音输入(包括分享页面),支持语音输入后自动发送,支持语音输入后自动语音播放(流式)。
2. 新增 - pptx 和 xlsx 文件读取。但所有文件读取都放服务端,会消耗更多的服务器资源,以及无法在上传时预览更多内容。
3. 新增 - 集成 Laf 云函数,可以读取 Laf 账号中的云函数作为 HTTP 模块。
4. 新增 - 定时器,清理垃圾数据。(采用小范围清理,会清理最近n个小时的,所以请保证服务持续运行,长时间不允许,可以继续执行 clearInvalidData 的接口进行全量清理。)
4. 新增 - 定时器,清理垃圾数据。(采用小范围清理,会清理最近 n 个小时的,所以请保证服务持续运行,长时间不允许,可以继续执行 clearInvalidData 的接口进行全量清理。)
5. 商业版新增 - 后台配置系统通知。
6. 优化 - 支持ip模式导出知识库。
7. 修改 - csv导入模板,取消 header 校验,自动获取前两列。
6. 优化 - 支持 ip 模式导出知识库。
7. 修改 - csv 导入模板,取消 header 校验,自动获取前两列。
8. 修复 - 工具调用模块连线数据类型校验错误。
9. 修复 - 自定义索引输入时,解构数据失败。
10. 修复 - rerank 模型数据格式。
11. 修复 - 问题补全历史记录BUG
12. 修复 - 分享页面特殊情况下加载缓慢问题(由于ssr时候数据库不会触发连接)
11. 修复 - 问题补全历史记录 BUG
12. 修复 - 分享页面特殊情况下加载缓慢问题(由于 ssr 时候数据库不会触发连接)
......@@ -13,7 +13,7 @@ description: FastGPT V4.8.16 Release Notes
### 2. Update configuration file
Refer to the latest [configuration file documentation](../../config/json.en.mdx) and update your `config.json` or admin model configuration. Add the `provider` field to LLMModel and VectorModel for model categorization. For example:
Update your `config.json` or admin model configuration. Add the `provider` field to LLMModel and VectorModel for model categorization. The legacy `config.json` guide is no longer maintained. For current versions, see [Model Configuration](../../config/model/intro.en.mdx). For example:
```json
{
......
......@@ -13,7 +13,7 @@ description: FastGPT V4.8.16 更新说明
### 2. 更新配置文件
参考最新的[配置文件](../../config/json.mdx),更新 `config.json` 或 admin 中模型文件配置。给 LLMModel 和 VectorModel 增加 `provider` 字段,以便进行模型分类。例如:
更新 `config.json` 或 admin 中模型文件配置。给 LLMModel 和 VectorModel 增加 `provider` 字段,以便进行模型分类。旧版 `config.json` 配置说明已不再维护,当前版本请参考[模型配置方案](../../config/model/intro.mdx)。例如:
```json
{
......
......@@ -160,7 +160,7 @@ curl --location --request POST 'https://{{host}}/api/admin/initv490' \
## Compatibility & Deprecations
1. Deprecated — The previous custom file parsing solution for private deployments. Please update to the latest configuration. [See PDF Enhanced Parsing Configuration](../../config/json.en.mdx#使用-doc2x-解析-pdf-文件)
1. Deprecated — The previous custom file parsing solution for private deployments. Please update to the latest environment-variable configuration. [See Environment Variables](../../config/env.en.mdx)
2. Deprecated — The legacy local file upload API: `/api/core/dataset/collection/create/file` (previously available only in the Pro edition). This endpoint has been replaced by: `/api/core/dataset/collection/create/localFile`
3. Maintenance ending, deprecation upcoming — External file library APIs. Use the API File Library as a replacement.
4. API Update — For endpoints that include a `trainingType` field (file upload to knowledge base, link collection creation, API file library, push chunk data, etc.), `trainingType` will only support `chunk` and `QA` modes going forward. Enhanced indexing mode will use a separate field: `autoIndexes`. Legacy `trainingType=auto` code is still supported for now, but please migrate to the new API format as soon as possible. See: [Knowledge Base OpenAPI Documentation](../../../openapi/dataset.en.mdx)
......
......@@ -160,7 +160,7 @@ curl --location --request POST 'https://{{host}}/api/admin/initv490' \
## 兼容 & 弃用
1. 弃用 - 之前私有化部署的自定义文件解析方案,请同步更新到最新的配置方案。[点击查看 PDF 增强解析配置](../../config/json.mdx#使用-doc2x-解析-pdf-文件)
1. 弃用 - 之前私有化部署的自定义文件解析方案,请同步更新到最新的环境变量配置方案。[点击查看环境变量说明](../../config/env.mdx)
2. 弃用 - 弃用旧版本地文件上传 API:/api/core/dataset/collection/create/file(以前仅商业版可用的 API,该接口已放切换成:/api/core/dataset/collection/create/localFile)
3. 停止维护,即将弃用 - 外部文件库相关 API,可通过 API 文件库替代。
4. API 更新 - 上传文件至知识库、创建连接集合、API 文件库、推送分块数据等带有 `trainingType` 字段的接口,`trainingType` 字段未来仅支持 `chunk` 和 `QA` 两种模式。增强索引模式将设置单独字段:`autoIndexes`,目前仍有适配旧版 `trainingType=auto` 代码,但请尽快变更成新接口类型。具体可见:[知识库 OpenAPI 文档](../../../openapi/dataset.mdx)
......
......@@ -87,13 +87,13 @@ description: FastGPT Toc
- [/en/plugin/model-presets](/en/plugin/model-presets)
- [/en/plugin/system-tool-development](/en/plugin/system-tool-development)
- [/en/self-host/config/env](/en/self-host/config/env)
- [/en/self-host/config/json](/en/self-host/config/json)
- [/en/self-host/config/model/intro](/en/self-host/config/model/intro)
- [/en/self-host/config/model/minimax](/en/self-host/config/model/minimax)
- [/en/self-host/config/model/siliconCloud](/en/self-host/config/model/siliconCloud)
- [/en/self-host/config/object-storage](/en/self-host/config/object-storage)
- [/en/self-host/config/remote-debug-suite](/en/self-host/config/remote-debug-suite)
- [/en/self-host/config/sandbox/common](/en/self-host/config/sandbox/common)
- [/en/self-host/config/sandbox/opensandbox](/en/self-host/config/sandbox/opensandbox)
- [/en/self-host/config/sandbox/sealosdevbox](/en/self-host/config/sandbox/sealosdevbox)
- [/en/self-host/config/signoz](/en/self-host/config/signoz)
- [/en/self-host/custom-models/bge-rerank](/en/self-host/custom-models/bge-rerank)
......
......@@ -87,13 +87,13 @@ description: FastGPT 文档目录
- [/plugin/model-presets](/plugin/model-presets)
- [/plugin/system-tool-development](/plugin/system-tool-development)
- [/self-host/config/env](/self-host/config/env)
- [/self-host/config/json](/self-host/config/json)
- [/self-host/config/model/intro](/self-host/config/model/intro)
- [/self-host/config/model/minimax](/self-host/config/model/minimax)
- [/self-host/config/model/siliconCloud](/self-host/config/model/siliconCloud)
- [/self-host/config/object-storage](/self-host/config/object-storage)
- [/self-host/config/remote-debug-suite](/self-host/config/remote-debug-suite)
- [/self-host/config/sandbox/common](/self-host/config/sandbox/common)
- [/self-host/config/sandbox/opensandbox](/self-host/config/sandbox/opensandbox)
- [/self-host/config/sandbox/sealosdevbox](/self-host/config/sandbox/sealosdevbox)
- [/self-host/config/signoz](/self-host/config/signoz)
- [/self-host/custom-models/bge-rerank](/self-host/custom-models/bge-rerank)
......
......@@ -167,10 +167,8 @@
"content/plugin/model-presets.mdx": "2026-06-04T16:10:15+08:00",
"content/plugin/system-tool-development.en.mdx": "2026-06-27T22:05:51+08:00",
"content/plugin/system-tool-development.mdx": "2026-06-27T22:05:51+08:00",
"content/self-host/config/env.en.mdx": "2026-06-30T16:19:46+08:00",
"content/self-host/config/env.mdx": "2026-06-30T16:19:46+08:00",
"content/self-host/config/json.en.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/config/json.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/config/env.en.mdx": "2026-06-30T17:31:43+08:00",
"content/self-host/config/env.mdx": "2026-06-30T17:31:43+08:00",
"content/self-host/config/model/intro.en.mdx": "2026-06-04T16:10:15+08:00",
"content/self-host/config/model/intro.mdx": "2026-06-04T16:10:15+08:00",
"content/self-host/config/model/minimax.en.mdx": "2026-06-03T10:40:17+08:00",
......@@ -181,8 +179,10 @@
"content/self-host/config/object-storage.mdx": "2026-05-21T11:24:48+08:00",
"content/self-host/config/remote-debug-suite.en.mdx": "2026-06-27T22:05:51+08:00",
"content/self-host/config/remote-debug-suite.mdx": "2026-06-27T22:05:51+08:00",
"content/self-host/config/sandbox/common.en.mdx": "2026-06-30T14:56:33+08:00",
"content/self-host/config/sandbox/common.mdx": "2026-06-30T14:56:33+08:00",
"content/self-host/config/sandbox/common.en.mdx": "2026-06-30T20:55:46+08:00",
"content/self-host/config/sandbox/common.mdx": "2026-06-30T20:55:46+08:00",
"content/self-host/config/sandbox/opensandbox.en.mdx": "2026-06-30T20:55:46+08:00",
"content/self-host/config/sandbox/opensandbox.mdx": "2026-06-30T20:55:46+08:00",
"content/self-host/config/sandbox/sealosdevbox.en.mdx": "2026-06-30T14:56:33+08:00",
"content/self-host/config/sandbox/sealosdevbox.mdx": "2026-06-30T14:56:33+08:00",
"content/self-host/config/signoz.en.mdx": "2026-04-26T21:08:47+08:00",
......@@ -203,10 +203,10 @@
"content/self-host/custom-models/ollama.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/custom-models/xinference.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/custom-models/xinference.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/deploy/docker.en.mdx": "2026-06-24T18:24:40+08:00",
"content/self-host/deploy/docker.mdx": "2026-06-24T18:24:40+08:00",
"content/self-host/deploy/sealos.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/deploy/sealos.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/deploy/docker.en.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/deploy/docker.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/deploy/sealos.en.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/deploy/sealos.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/design/dataset.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/design/dataset.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/dev.en.mdx": "2026-04-26T21:08:47+08:00",
......@@ -297,21 +297,21 @@
"content/self-host/upgrading/4-14/41481.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/4-14/4149.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/4-14/4149.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/4-15/41500.en.mdx": "2026-06-29T00:47:43+08:00",
"content/self-host/upgrading/4-15/41500.mdx": "2026-06-29T23:38:28+08:00",
"content/self-host/upgrading/4-15/41500.en.mdx": "2026-06-30T20:55:46+08:00",
"content/self-host/upgrading/4-15/41500.mdx": "2026-06-30T20:55:46+08:00",
"content/self-host/upgrading/4-15/41501.mdx": "2026-06-23T21:09:39+08:00",
"content/self-host/upgrading/4-15/41502.en.mdx": "2026-05-25T11:21:30+08:00",
"content/self-host/upgrading/4-15/41502.mdx": "2026-06-23T13:54:06+08:00",
"content/self-host/upgrading/4-15/41503.en.mdx": "2026-05-28T16:21:09+08:00",
"content/self-host/upgrading/4-15/41503.mdx": "2026-05-28T16:21:09+08:00",
"content/self-host/upgrading/4-15/41503.en.mdx": "2026-06-30T20:55:46+08:00",
"content/self-host/upgrading/4-15/41503.mdx": "2026-06-30T20:55:46+08:00",
"content/self-host/upgrading/4-15/41504.en.mdx": "2026-06-10T19:02:59+08:00",
"content/self-host/upgrading/4-15/41504.mdx": "2026-06-15T23:34:43+08:00",
"content/self-host/upgrading/4-15/41505.en.mdx": "2026-06-29T10:49:24+08:00",
"content/self-host/upgrading/4-15/41505.mdx": "2026-06-29T10:45:58+08:00",
"content/self-host/upgrading/4-15/41506.en.mdx": "2026-06-29T00:47:43+08:00",
"content/self-host/upgrading/4-15/41506.mdx": "2026-06-29T00:47:43+08:00",
"content/self-host/upgrading/4-15/41507.en.mdx": "2026-06-30T16:19:46+08:00",
"content/self-host/upgrading/4-15/41507.mdx": "2026-06-30T16:19:46+08:00",
"content/self-host/upgrading/4-15/41506.en.mdx": "2026-06-30T20:55:46+08:00",
"content/self-host/upgrading/4-15/41506.mdx": "2026-06-30T20:55:46+08:00",
"content/self-host/upgrading/4-15/41507.en.mdx": "2026-06-30T17:31:43+08:00",
"content/self-host/upgrading/4-15/41507.mdx": "2026-06-30T17:31:43+08:00",
"content/self-host/upgrading/outdated/40.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/40.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/41.en.mdx": "2026-04-26T21:08:47+08:00",
......@@ -342,14 +342,14 @@
"content/self-host/upgrading/outdated/446.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/447.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/447.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/45.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/45.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/45.en.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/45.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/451.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/451.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/452.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/452.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/46.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/46.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/46.en.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/46.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/461.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/461.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/462.en.mdx": "2026-04-26T21:08:47+08:00",
......@@ -358,20 +358,20 @@
"content/self-host/upgrading/outdated/463.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/464.en.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/upgrading/outdated/464.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/upgrading/outdated/465.en.mdx": "2026-05-07T15:06:40+08:00",
"content/self-host/upgrading/outdated/465.mdx": "2026-05-07T15:06:40+08:00",
"content/self-host/upgrading/outdated/466.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/466.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/465.en.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/465.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/466.en.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/466.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/467.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/467.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/468.en.mdx": "2026-05-07T15:06:40+08:00",
"content/self-host/upgrading/outdated/468.mdx": "2026-05-07T15:06:40+08:00",
"content/self-host/upgrading/outdated/468.en.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/468.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/469.en.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/upgrading/outdated/469.mdx": "2026-06-22T11:01:59+08:00",
"content/self-host/upgrading/outdated/47.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/47.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/471.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/471.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/47.en.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/47.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/471.en.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/471.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/48.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/48.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/481.en.mdx": "2026-04-26T21:08:47+08:00",
......@@ -388,8 +388,8 @@
"content/self-host/upgrading/outdated/4814.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/4815.en.mdx": "2026-05-07T15:06:40+08:00",
"content/self-host/upgrading/outdated/4815.mdx": "2026-05-07T15:06:40+08:00",
"content/self-host/upgrading/outdated/4816.en.mdx": "2026-06-04T16:10:15+08:00",
"content/self-host/upgrading/outdated/4816.mdx": "2026-06-04T16:10:15+08:00",
"content/self-host/upgrading/outdated/4816.en.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/4816.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/4817.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/4817.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/4818.en.mdx": "2026-04-26T21:08:47+08:00",
......@@ -420,8 +420,8 @@
"content/self-host/upgrading/outdated/488.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/489.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/489.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/490.en.mdx": "2026-05-24T00:53:50+08:00",
"content/self-host/upgrading/outdated/490.mdx": "2026-05-24T00:53:50+08:00",
"content/self-host/upgrading/outdated/490.en.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/490.mdx": "2026-06-30T18:30:01+08:00",
"content/self-host/upgrading/outdated/491.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/491.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/outdated/4910.en.mdx": "2026-04-26T21:08:47+08:00",
......@@ -452,6 +452,6 @@
"content/self-host/upgrading/outdated/499.mdx": "2026-05-07T15:06:40+08:00",
"content/self-host/upgrading/upgrade-intruction.en.mdx": "2026-04-26T21:08:47+08:00",
"content/self-host/upgrading/upgrade-intruction.mdx": "2026-04-26T21:08:47+08:00",
"content/toc.en.mdx": "2026-06-30T14:56:33+08:00",
"content/toc.mdx": "2026-06-30T14:56:33+08:00"
"content/toc.en.mdx": "2026-06-30T20:55:46+08:00",
"content/toc.mdx": "2026-06-30T20:55:46+08:00"
}
\ No newline at end of file
......@@ -48,7 +48,6 @@ x-vec-config: &x-vec-config
MILVUS_TOKEN: none
services:
# Vector DB
fastgpt-milvus-minio:
container_name: fastgpt-milvus-minio
image: minio/minio:RELEASE.2023-03-20T20-16-18Z
......@@ -193,7 +192,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
......@@ -285,15 +284,10 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
read_only: true
tmpfs:
- /tmp:size=128m,noexec,nosuid,nodev
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
......@@ -344,7 +338,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......@@ -354,7 +348,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.6.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
......@@ -382,7 +376,7 @@ services:
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.5.8
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
......
......@@ -47,7 +47,6 @@ x-vec-config: &x-vec-config
OCEANBASE_URL: mysql://root%40tenantname:tenantpassword@fastgpt-vector:2881/mysql
services:
# Vector DB
fastgpt-vector:
image: oceanbase/oceanbase-ce:4.3.5-lts
container_name: fastgpt-ob
......@@ -171,7 +170,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
......@@ -263,15 +262,10 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
read_only: true
tmpfs:
- /tmp:size=128m,noexec,nosuid,nodev
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
......@@ -322,7 +316,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......@@ -332,7 +326,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.6.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
......@@ -360,7 +354,7 @@ services:
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.5.8
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
......
......@@ -47,7 +47,6 @@ x-vec-config: &x-vec-config
OPENGAUSS_URL: postgresql://gaussdb:FastGPT@123@fastgpt-vector:5432/fastgpt
services:
# Vector DB
fastgpt-vector:
image: opengauss/opengauss:7.0.0-RC1
container_name: fastgpt-opengauss
......@@ -155,7 +154,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
......@@ -247,15 +246,10 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
read_only: true
tmpfs:
- /tmp:size=128m,noexec,nosuid,nodev
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
......@@ -306,7 +300,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......@@ -316,7 +310,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.6.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
......@@ -344,7 +338,7 @@ services:
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.5.8
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
......
......@@ -47,7 +47,6 @@ x-vec-config: &x-vec-config
PG_URL: postgresql://username:password@fastgpt-vector:5432/postgres
services:
# Vector DB
fastgpt-vector:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:0.8.0-pg15
container_name: fastgpt-pg
......@@ -153,7 +152,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
......@@ -245,15 +244,10 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
read_only: true
tmpfs:
- /tmp:size=128m,noexec,nosuid,nodev
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
......@@ -304,7 +298,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......@@ -314,7 +308,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.6.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
......@@ -342,7 +336,7 @@ services:
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.5.8
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
......
......@@ -47,7 +47,6 @@ x-vec-config: &x-vec-config
SEEKDB_URL: mysql://root:seekdbpassword@fastgpt-vector:2881/mysql
services:
# Vector DB
fastgpt-vector:
image: oceanbase/seekdb:1.0.1.0-100000392025122619
container_name: fastgpt-seekdb
......@@ -158,7 +157,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
......@@ -250,15 +249,10 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
read_only: true
tmpfs:
- /tmp:size=128m,noexec,nosuid,nodev
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
......@@ -309,7 +303,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......@@ -319,7 +313,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.6.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
......@@ -347,7 +341,7 @@ services:
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.5.8
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
......
......@@ -48,8 +48,6 @@ x-vec-config: &x-vec-config
MILVUS_TOKEN: zilliz_cloud_token
services:
# Vector DB
fastgpt-mongo:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
......@@ -137,7 +135,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
......@@ -229,15 +227,10 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
read_only: true
tmpfs:
- /tmp:size=128m,noexec,nosuid,nodev
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
......@@ -288,7 +281,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.15.0-beta1
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......@@ -298,7 +291,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.6.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
......@@ -326,7 +319,7 @@ services:
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.5.8
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
......
......@@ -48,7 +48,6 @@ x-vec-config: &x-vec-config
MILVUS_TOKEN: none
services:
# Vector DB
fastgpt-milvus-minio:
container_name: fastgpt-milvus-minio
image: minio/minio:RELEASE.2023-03-20T20-16-18Z
......@@ -193,7 +192,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.0-beta1
image: ghcr.io/labring/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
......@@ -285,15 +284,10 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0-beta1
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
read_only: true
tmpfs:
- /tmp:size=128m,noexec,nosuid,nodev
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
......@@ -344,7 +338,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.15.0-beta1
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......@@ -354,7 +348,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v0.6.2
image: ghcr.io/labring/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
......@@ -382,7 +376,7 @@ services:
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.5.8
image: ghcr.io/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
......
......@@ -47,7 +47,6 @@ x-vec-config: &x-vec-config
OCEANBASE_URL: mysql://root%40tenantname:tenantpassword@fastgpt-vector:2881/mysql
services:
# Vector DB
fastgpt-vector:
image: oceanbase/oceanbase-ce:4.3.5-lts
container_name: fastgpt-ob
......@@ -171,7 +170,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.0-beta1
image: ghcr.io/labring/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
......@@ -263,15 +262,10 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0-beta1
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
read_only: true
tmpfs:
- /tmp:size=128m,noexec,nosuid,nodev
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
......@@ -322,7 +316,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.15.0-beta1
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......@@ -332,7 +326,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v0.6.2
image: ghcr.io/labring/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
......@@ -360,7 +354,7 @@ services:
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.5.8
image: ghcr.io/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
......
......@@ -47,7 +47,6 @@ x-vec-config: &x-vec-config
OPENGAUSS_URL: postgresql://gaussdb:FastGPT@123@fastgpt-vector:5432/fastgpt
services:
# Vector DB
fastgpt-vector:
image: opengauss/opengauss:7.0.0-RC1
container_name: fastgpt-opengauss
......@@ -155,7 +154,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.0-beta1
image: ghcr.io/labring/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
......@@ -247,15 +246,10 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0-beta1
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
read_only: true
tmpfs:
- /tmp:size=128m,noexec,nosuid,nodev
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
......@@ -306,7 +300,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.15.0-beta1
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......@@ -316,7 +310,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v0.6.2
image: ghcr.io/labring/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
......@@ -344,7 +338,7 @@ services:
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.5.8
image: ghcr.io/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
......
......@@ -47,7 +47,6 @@ x-vec-config: &x-vec-config
PG_URL: postgresql://username:password@fastgpt-vector:5432/postgres
services:
# Vector DB
fastgpt-vector:
image: pgvector/pgvector:0.8.0-pg15
container_name: fastgpt-pg
......@@ -153,7 +152,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.0-beta1
image: ghcr.io/labring/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
......@@ -245,15 +244,10 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0-beta1
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
read_only: true
tmpfs:
- /tmp:size=128m,noexec,nosuid,nodev
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
......@@ -304,7 +298,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.15.0-beta1
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......@@ -314,7 +308,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v0.6.2
image: ghcr.io/labring/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
......@@ -342,7 +336,7 @@ services:
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.5.8
image: ghcr.io/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
......
......@@ -47,7 +47,6 @@ x-vec-config: &x-vec-config
SEEKDB_URL: mysql://root:seekdbpassword@fastgpt-vector:2881/mysql
services:
# Vector DB
fastgpt-vector:
image: oceanbase/seekdb:1.0.1.0-100000392025122619
container_name: fastgpt-seekdb
......@@ -158,7 +157,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.0-beta1
image: ghcr.io/labring/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
......@@ -250,15 +249,10 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0-beta1
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
read_only: true
tmpfs:
- /tmp:size=128m,noexec,nosuid,nodev
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
......@@ -309,7 +303,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.15.0-beta1
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......@@ -319,7 +313,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v0.6.2
image: ghcr.io/labring/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
......@@ -347,7 +341,7 @@ services:
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.5.8
image: ghcr.io/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
......
......@@ -48,8 +48,6 @@ x-vec-config: &x-vec-config
MILVUS_TOKEN: zilliz_cloud_token
services:
# Vector DB
fastgpt-mongo:
image: mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
......@@ -137,7 +135,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.0-beta1
image: ghcr.io/labring/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
......@@ -229,15 +227,10 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0-beta1
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
read_only: true
tmpfs:
- /tmp:size=128m,noexec,nosuid,nodev
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
......@@ -288,7 +281,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.15.0-beta1
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......@@ -298,7 +291,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v0.6.2
image: ghcr.io/labring/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
......@@ -326,7 +319,7 @@ services:
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.5.8
image: ghcr.io/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
......
......@@ -50,7 +50,6 @@ x-vec-config: &x-vec-config
MILVUS_TOKEN: none
services:
# Vector DB
fastgpt-milvus-minio:
container_name: fastgpt-milvus-minio
image: minio/minio:RELEASE.2023-03-20T20-16-18Z
......@@ -325,7 +324,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.22
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......
......@@ -49,7 +49,6 @@ x-vec-config: &x-vec-config
OCEANBASE_URL: mysql://root%40tenantname:tenantpassword@fastgpt-vector:2881/mysql
services:
# Vector DB
fastgpt-vector:
image: oceanbase/oceanbase-ce:4.3.5-lts
container_name: fastgpt-ob
......@@ -303,7 +302,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.22
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......
......@@ -49,7 +49,6 @@ x-vec-config: &x-vec-config
OPENGAUSS_URL: postgresql://gaussdb:FastGPT@123@fastgpt-vector:5432/fastgpt
services:
# Vector DB
fastgpt-vector:
image: opengauss/opengauss:7.0.0-RC1
container_name: fastgpt-opengauss
......@@ -287,7 +286,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.22
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......
......@@ -49,7 +49,6 @@ x-vec-config: &x-vec-config
PG_URL: postgresql://username:password@fastgpt-vector:5432/postgres
services:
# Vector DB
fastgpt-vector:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:0.8.0-pg15
container_name: fastgpt-pg
......@@ -285,7 +284,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.22
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......
......@@ -49,7 +49,6 @@ x-vec-config: &x-vec-config
SEEKDB_URL: mysql://root:seekdbpassword@fastgpt-vector:2881/mysql
services:
# Vector DB
fastgpt-vector:
image: oceanbase/seekdb:1.0.1.0-100000392025122619
container_name: fastgpt-seekdb
......@@ -290,7 +289,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.22
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......
......@@ -50,8 +50,6 @@ x-vec-config: &x-vec-config
MILVUS_TOKEN: zilliz_cloud_token
services:
# Vector DB
fastgpt-mongo:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
......@@ -269,7 +267,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.22
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......
......@@ -50,7 +50,6 @@ x-vec-config: &x-vec-config
MILVUS_TOKEN: none
services:
# Vector DB
fastgpt-milvus-minio:
container_name: fastgpt-milvus-minio
image: minio/minio:RELEASE.2023-03-20T20-16-18Z
......@@ -325,7 +324,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.22
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......
......@@ -49,7 +49,6 @@ x-vec-config: &x-vec-config
OCEANBASE_URL: mysql://root%40tenantname:tenantpassword@fastgpt-vector:2881/mysql
services:
# Vector DB
fastgpt-vector:
image: oceanbase/oceanbase-ce:4.3.5-lts
container_name: fastgpt-ob
......@@ -303,7 +302,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.22
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......
......@@ -49,7 +49,6 @@ x-vec-config: &x-vec-config
OPENGAUSS_URL: postgresql://gaussdb:FastGPT@123@fastgpt-vector:5432/fastgpt
services:
# Vector DB
fastgpt-vector:
image: opengauss/opengauss:7.0.0-RC1
container_name: fastgpt-opengauss
......@@ -287,7 +286,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.22
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......
......@@ -49,7 +49,6 @@ x-vec-config: &x-vec-config
PG_URL: postgresql://username:password@fastgpt-vector:5432/postgres
services:
# Vector DB
fastgpt-vector:
image: pgvector/pgvector:0.8.0-pg15
container_name: fastgpt-pg
......@@ -285,7 +284,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.22
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......
......@@ -49,7 +49,6 @@ x-vec-config: &x-vec-config
SEEKDB_URL: mysql://root:seekdbpassword@fastgpt-vector:2881/mysql
services:
# Vector DB
fastgpt-vector:
image: oceanbase/seekdb:1.0.1.0-100000392025122619
container_name: fastgpt-seekdb
......@@ -290,7 +289,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.22
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......
......@@ -50,8 +50,6 @@ x-vec-config: &x-vec-config
MILVUS_TOKEN: zilliz_cloud_token
services:
# Vector DB
fastgpt-mongo:
image: mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
......@@ -269,7 +267,7 @@ services:
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.22
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
......
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw "1234"
# 系统最高密钥凭证
x-system-key: &x-system-key "fastgpt-xxx"
# 用户登录 JWT 密钥
x-token-key: &x-token-key "fastgpt"
# 文件阅读 token 密钥
x-file-token-key: &x-file-token-key "filetokenkey"
# 密钥加密 key
x-aes256-secret-key: &x-aes256-secret-key "fastgptsecret"
# Invoke 反向调用 JWT 密钥,至少 32 位
x-invoke-token-secret: &x-invoke-token-secret "fastgpt_invoke_token_secret_32_chars_min"
# plugin auth token,v4.15 plugin 服务要求至少 32 位
x-plugin-auth-token: &x-plugin-auth-token "fastgpt-plugin-token-please-change"
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token "codesandbox"
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token "vmtoken"
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"
# aiproxy token
x-aiproxy-token: &x-aiproxy-token "token"
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@fastgpt-redis:6379
# @see https://doc.fastgpt.cn/self-host/config/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_CDN_ENDPOINT:
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATH:
# Log 配置
x-log-config: &x-log-config
LOG_ENABLE_CONSOLE: true
LOG_CONSOLE_LEVEL: debug
LOG_ENABLE_OTEL: false
LOG_OTEL_LEVEL: info
LOG_OTEL_URL: http://localhost:4318/v1/logs
LOG_OTEL_SERVICE_NAME: fastgpt-client
METRICS_ENABLE_OTEL: false
METRICS_OTEL_URL: http://localhost:4318/v1/metrics
METRICS_OTEL_SERVICE_NAME: fastgpt-client
TRACING_ENABLE_OTEL: false
TRACING_OTEL_URL: http://localhost:4318/v1/traces
TRACING_OTEL_SERVICE_NAME: fastgpt-client
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的服务地址配置
x-fastgpt-service-config: &x-fastgpt-service-config
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
CODE_SANDBOX_URL: http://fastgpt-code-sandbox:3000
CODE_SANDBOX_TOKEN: *x-code-sandbox-token
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
AIPROXY_API_TOKEN: *x-aiproxy-token
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的地址。启用 Agent/Skill 沙盒时,必须改成单独部署的 proxy 的 ws:// 或 wss:// 地址。
AGENT_SANDBOX_PROXY_URL:
AGENT_SANDBOX_OPENSANDBOX_BASEURL:
AGENT_SANDBOX_OPENSANDBOX_API_KEY:
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG: v0.2.0
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
DEFAULT_ROOT_PSW: *x-default-root-psw
SYSTEM_NAME: FastGPT
SYSTEM_DESCRIPTION:
SYSTEM_FAVICON:
SSE_MCP_SERVER_PROXY_ENDPOINT:
MARKETPLACE_URL: https://v2.marketplace.fastgpt.cn
PASSWORD_EXPIRED_MONTH:
SHOW_COUPON: false
SHOW_DISCOUNT_COUPON: false
HIDE_CHAT_COPYRIGHT_SETTING:
CHINESE_IP_REDIRECT_URL:
PAY_FORM_URL:
AGENT_SANDBOX_FREE_TIP: false
OPENAPI_KEY_MAX_COUNT: 100
# FastGPT 与 Pro 共用环境变量(packages/service/env.ts · serviceEnv)
x-service-env-config: &x-service-env-config
HOSTNAME: 0.0.0.0
NEXT_PUBLIC_BASE_URL:
ROOT_KEY: *x-system-key
DB_MAX_LINK: 5
SYNC_INDEX: true
TOKEN_KEY: *x-token-key
FILE_TOKEN_KEY: *x-file-token-key
AES256_SECRET_KEY: *x-aes256-secret-key
INVOKE_TOKEN_SECRET: *x-invoke-token-secret
MULTIPLE_DATA_TO_BASE64: true
USE_IP_LIMIT: false
CHECK_INTERNAL_IP: false
TRUSTED_PROXY_ENABLE: false
TRUSTED_PROXY_IPS:
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
HELPER_BOT_MODEL: qwen-max
CHAT_TITLE_MODEL:
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 10
PARSE_FILE_TIMEOUT_SECONDS: 600
HTML_TO_MARKDOWN_WORKERS: 10
TEXT_TO_CHUNKS_WORKERS: 10
WORKFLOW_MAX_RUN_TIMES: 500
WORKFLOW_MAX_LOOP_TIMES: 100
WORKFLOW_PARALLEL_MAX_CONCURRENCY: 10
CHAT_MAX_QPM: 5000
SYSTEM_MAX_STRING_LENGTH_M: 100
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
MAX_FOLDER_DEPTH: 4
APP_FOLDER_MAX_AMOUNT: 1000
DATASET_FOLDER_MAX_AMOUNT: 1000
UPLOAD_FILE_MAX_SIZE: 1000
UPLOAD_FILE_MAX_AMOUNT: 1000
LLM_REQUEST_TRACKING_RETENTION_HOURS: 6
MAX_HTML_TRANSFORM_CHARS: 1000000
DATASET_PARSE_MAX_PROCESS: 10
VECTOR_MAX_PROCESS: 10
QA_MAX_PROCESS: 10
VLM_MAX_PROCESS: 10
HNSW_EF_SEARCH: 100
HNSW_MAX_SCAN_TUPLES: 100000
CUSTOM_PDF_PARSE_URL:
CUSTOM_PDF_PARSE_KEY:
DOC2X_KEY:
TEXTIN_APP_ID:
TEXTIN_SECRET_CODE:
CUSTOM_PDF_PARSE_PRICE: 0
FILE_URL_WHITELIST:
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
MILVUS_ADDRESS: http://fastgpt-vector:19530
MILVUS_TOKEN: none
services:
fastgpt-milvus-minio:
container_name: fastgpt-milvus-minio
image: minio/minio:RELEASE.2023-03-20T20-16-18Z
environment:
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
networks:
- vector
volumes:
- fastgpt-milvus-minio:/minio_data
command: minio server /minio_data --console-address ":9001"
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 30s
timeout: 20s
retries: 3
# milvus
fastgpt-milvus-etcd:
container_name: fastgpt-milvus-etcd
image: quay.io/coreos/etcd:v3.5.5
environment:
- ETCD_AUTO_COMPACTION_MODE=revision
- ETCD_AUTO_COMPACTION_RETENTION=1000
- ETCD_QUOTA_BACKEND_BYTES=4294967296
- ETCD_SNAPSHOT_COUNT=50000
networks:
- vector
volumes:
- fastgpt-milvus-etcd:/etcd
command: etcd -advertise-client-urls=http://127.0.0.1:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
healthcheck:
test: ['CMD', 'etcdctl', 'endpoint', 'health']
interval: 30s
timeout: 20s
retries: 3
fastgpt-vector:
container_name: fastgpt-milvus-standalone
image: milvusdb/milvus:v2.4.3
command: ['milvus', 'run', 'standalone']
security_opt:
- seccomp:unconfined
environment:
ETCD_ENDPOINTS: fastgpt-milvus-etcd:2379
MINIO_ADDRESS: fastgpt-milvus-minio:9000
networks:
- data
volumes:
- fastgpt-milvus-data:/var/lib/milvus
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9091/healthz']
interval: 30s
start_period: 90s
timeout: 20s
retries: 3
depends_on:
- 'fastgpt-milvus-etcd'
- 'fastgpt-milvus-minio'
fastgpt-mongo:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
restart: always
networks:
- data
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- fastgpt-mongo:/data/db
healthcheck:
test:
[
"CMD",
"mongo",
"-u",
"myusername",
"-p",
"mypassword",
"--authenticationDatabase",
"admin",
"--eval",
"db.adminCommand('ping')",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "fastgpt-mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
fastgpt-redis:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/redis:7.2-alpine
container_name: fastgpt-redis
networks:
- data
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ["CMD", "redis-cli", "-a", "mypassword", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- fastgpt-redis:/data
fastgpt-minio:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- data
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
- data
- app
- codesandbox
- aiproxy
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-redis:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
fastgpt-code-sandbox:
condition: service_healthy
fastgpt-plugin:
condition: service_healthy
restart: always
environment:
# 完整变量请参考: https://github.com/labring/FastGPT/blob/main/projects/app/.env.template
<<:
[
*x-share-db-config,
*x-vec-config,
*x-log-config,
*x-no-proxy-config,
*x-fastgpt-service-config,
*x-agent-sandbox-config,
*x-service-env-config,
*x-app-env-config,
]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
security_opt:
- no-new-privileges:true
environment:
<<: [*x-log-config, *x-no-proxy-config]
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
SANDBOX_TOKEN: *x-code-sandbox-token
# ===== Resource Limits =====
# Maximum API JSON body size (MB), including variables
SANDBOX_API_MAX_BODY_MB: 8
# Execution timeout per request (ms)
SANDBOX_MAX_TIMEOUT: 60000
# Maximum allowed memory per user code execution (MB)
# Note: System automatically adds 50MB for runtime overhead
# Actual process limit = SANDBOX_MAX_MEMORY_MB + 50MB
SANDBOX_MAX_MEMORY_MB: 256
SANDBOX_MAX_OUTPUT_MB: 10
# Number of requests with the same queueId that may enter execution concurrently. Empty disables queueing.
SANDBOX_QUEUE_ID_CONCURRENCY:
# ===== Process Pool =====
# Number of pre-warmed worker processes (JS + Python)
SANDBOX_POOL_SIZE: 20
# ===== Network Request Limits =====
# Whether to check if the request is to a private network
CHECK_INTERNAL_IP: true
# Maximum number of HTTP requests per execution
SANDBOX_REQUEST_MAX_COUNT: 30
# Timeout for each outbound HTTP request (ms)
SANDBOX_REQUEST_TIMEOUT: 60000
# Maximum response body size for outbound requests
SANDBOX_REQUEST_MAX_RESPONSE_MB: 10
# Maximum request body size for outbound requests (MB)
SANDBOX_REQUEST_MAX_BODY_MB: 5
# ===== Module Control =====
# JS allowed modules whitelist (comma-separated)
SANDBOX_JS_ALLOWED_MODULES: lodash,dayjs,moment,uuid,crypto-js,qs,url,querystring
# Python allowed modules whitelist (comma-separated)
SANDBOX_PYTHON_ALLOWED_MODULES: math,cmath,decimal,fractions,random,statistics,collections,array,heapq,bisect,queue,copy,itertools,functools,operator,string,re,difflib,textwrap,unicodedata,codecs,datetime,time,calendar,_strptime,json,csv,base64,binascii,struct,hashlib,hmac,secrets,uuid,typing,abc,enum,dataclasses,contextlib,pprint,weakref,numpy,pandas,matplotlib
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) throw new Error(String(res.status)); })",
]
interval: 30s
timeout: 20s
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
- 3003:3000
restart: always
environment:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
- data
- app
environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
# v4.15 plugin 服务使用独立数据库,避免和 FastGPT 主库集合冲突。
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
# 传递给 OTLP 收集器的服务名称
LOG_OTEL_SERVICE_NAME: fastgpt-plugin
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 20s
retries: 3
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
fastgpt-aiproxy-pg:
condition: service_healthy
networks:
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@fastgpt-aiproxy-pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
DISABLE_MODEL_CONFIG: true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
interval: 5s
timeout: 5s
retries: 10
fastgpt-aiproxy-pg:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:0.8.0-pg15 # docker hub
restart: unless-stopped
container_name: fastgpt-aiproxy-pg
volumes:
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
environment:
TZ: Asia/Shanghai
POSTGRES_USER: postgres
POSTGRES_DB: aiproxy
POSTGRES_PASSWORD: aiproxy
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
interval: 5s
timeout: 5s
retries: 10
networks:
data:
name: fastgpt_data
vector:
name: fastgpt_vector
app:
name: fastgpt_app
codesandbox:
name: fastgpt_codesandbox
aiproxy:
name: fastgpt_aiproxy
volumes:
fastgpt-pg:
fastgpt-mongo:
fastgpt-redis:
fastgpt-minio:
fastgpt-milvus-minio:
fastgpt-milvus-etcd:
fastgpt-milvus-data:
fastgpt-ob-data:
fastgpt-ob-config:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw "1234"
# 系统最高密钥凭证
x-system-key: &x-system-key "fastgpt-xxx"
# 用户登录 JWT 密钥
x-token-key: &x-token-key "fastgpt"
# 文件阅读 token 密钥
x-file-token-key: &x-file-token-key "filetokenkey"
# 密钥加密 key
x-aes256-secret-key: &x-aes256-secret-key "fastgptsecret"
# Invoke 反向调用 JWT 密钥,至少 32 位
x-invoke-token-secret: &x-invoke-token-secret "fastgpt_invoke_token_secret_32_chars_min"
# plugin auth token,v4.15 plugin 服务要求至少 32 位
x-plugin-auth-token: &x-plugin-auth-token "fastgpt-plugin-token-please-change"
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token "codesandbox"
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token "vmtoken"
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"
# aiproxy token
x-aiproxy-token: &x-aiproxy-token "token"
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@fastgpt-redis:6379
# @see https://doc.fastgpt.cn/self-host/config/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_CDN_ENDPOINT:
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATH:
# Log 配置
x-log-config: &x-log-config
LOG_ENABLE_CONSOLE: true
LOG_CONSOLE_LEVEL: debug
LOG_ENABLE_OTEL: false
LOG_OTEL_LEVEL: info
LOG_OTEL_URL: http://localhost:4318/v1/logs
LOG_OTEL_SERVICE_NAME: fastgpt-client
METRICS_ENABLE_OTEL: false
METRICS_OTEL_URL: http://localhost:4318/v1/metrics
METRICS_OTEL_SERVICE_NAME: fastgpt-client
TRACING_ENABLE_OTEL: false
TRACING_OTEL_URL: http://localhost:4318/v1/traces
TRACING_OTEL_SERVICE_NAME: fastgpt-client
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的服务地址配置
x-fastgpt-service-config: &x-fastgpt-service-config
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
CODE_SANDBOX_URL: http://fastgpt-code-sandbox:3000
CODE_SANDBOX_TOKEN: *x-code-sandbox-token
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
AIPROXY_API_TOKEN: *x-aiproxy-token
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的地址。启用 Agent/Skill 沙盒时,必须改成单独部署的 proxy 的 ws:// 或 wss:// 地址。
AGENT_SANDBOX_PROXY_URL:
AGENT_SANDBOX_OPENSANDBOX_BASEURL:
AGENT_SANDBOX_OPENSANDBOX_API_KEY:
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG: v0.2.0
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
DEFAULT_ROOT_PSW: *x-default-root-psw
SYSTEM_NAME: FastGPT
SYSTEM_DESCRIPTION:
SYSTEM_FAVICON:
SSE_MCP_SERVER_PROXY_ENDPOINT:
MARKETPLACE_URL: https://v2.marketplace.fastgpt.cn
PASSWORD_EXPIRED_MONTH:
SHOW_COUPON: false
SHOW_DISCOUNT_COUPON: false
HIDE_CHAT_COPYRIGHT_SETTING:
CHINESE_IP_REDIRECT_URL:
PAY_FORM_URL:
AGENT_SANDBOX_FREE_TIP: false
OPENAPI_KEY_MAX_COUNT: 100
# FastGPT 与 Pro 共用环境变量(packages/service/env.ts · serviceEnv)
x-service-env-config: &x-service-env-config
HOSTNAME: 0.0.0.0
NEXT_PUBLIC_BASE_URL:
ROOT_KEY: *x-system-key
DB_MAX_LINK: 5
SYNC_INDEX: true
TOKEN_KEY: *x-token-key
FILE_TOKEN_KEY: *x-file-token-key
AES256_SECRET_KEY: *x-aes256-secret-key
INVOKE_TOKEN_SECRET: *x-invoke-token-secret
MULTIPLE_DATA_TO_BASE64: true
USE_IP_LIMIT: false
CHECK_INTERNAL_IP: false
TRUSTED_PROXY_ENABLE: false
TRUSTED_PROXY_IPS:
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
HELPER_BOT_MODEL: qwen-max
CHAT_TITLE_MODEL:
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 10
PARSE_FILE_TIMEOUT_SECONDS: 600
HTML_TO_MARKDOWN_WORKERS: 10
TEXT_TO_CHUNKS_WORKERS: 10
WORKFLOW_MAX_RUN_TIMES: 500
WORKFLOW_MAX_LOOP_TIMES: 100
WORKFLOW_PARALLEL_MAX_CONCURRENCY: 10
CHAT_MAX_QPM: 5000
SYSTEM_MAX_STRING_LENGTH_M: 100
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
MAX_FOLDER_DEPTH: 4
APP_FOLDER_MAX_AMOUNT: 1000
DATASET_FOLDER_MAX_AMOUNT: 1000
UPLOAD_FILE_MAX_SIZE: 1000
UPLOAD_FILE_MAX_AMOUNT: 1000
LLM_REQUEST_TRACKING_RETENTION_HOURS: 6
MAX_HTML_TRANSFORM_CHARS: 1000000
DATASET_PARSE_MAX_PROCESS: 10
VECTOR_MAX_PROCESS: 10
QA_MAX_PROCESS: 10
VLM_MAX_PROCESS: 10
HNSW_EF_SEARCH: 100
HNSW_MAX_SCAN_TUPLES: 100000
CUSTOM_PDF_PARSE_URL:
CUSTOM_PDF_PARSE_KEY:
DOC2X_KEY:
TEXTIN_APP_ID:
TEXTIN_SECRET_CODE:
CUSTOM_PDF_PARSE_PRICE: 0
FILE_URL_WHITELIST:
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
OCEANBASE_URL: mysql://root%40tenantname:tenantpassword@fastgpt-vector:2881/mysql
services:
fastgpt-vector:
image: oceanbase/oceanbase-ce:4.3.5-lts
container_name: fastgpt-ob
restart: always
# ports: # 生产环境建议不要暴露
# - 2881:2881
networks:
- data
environment:
# 这里的配置只有首次运行生效。修改后,重启镜像是不会生效的。需要把持久化数据删除再重启,才有效果
- OB_SYS_PASSWORD=obsyspassword
# 不同于传统数据库,OceanBase 数据库的账号包含更多字段,包括用户名、租户名和集群名。经典格式为"用户名@租户名#集群名"
# 比如用mysql客户端连接时,根据本文件的默认配置,应该指定 "-uroot@tenantname"
- OB_TENANT_NAME=tenantname
- OB_TENANT_PASSWORD=tenantpassword
# MODE分为MINI和NORMAL, 后者会最大程度使用主机资源
- MODE=MINI
- OB_SERVER_IP=127.0.0.1
# 更多环境变量配置见oceanbase官方文档: https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000002013494
volumes:
- fastgpt-ob-data:/root/ob
- fastgpt-ob-config:/root/.obd/cluster
configs:
- source: init_sql
target: /root/boot/init.d/init.sql
healthcheck:
# obclient -h127.0.0.1 -P2881 -uroot@tenantname -ptenantpassword -e "SELECT 1;"
test:
[
"CMD-SHELL",
'obclient -h$${OB_SERVER_IP} -P2881 -uroot@$${OB_TENANT_NAME} -p$${OB_TENANT_PASSWORD} -e "SELECT 1;"',
]
interval: 30s
timeout: 10s
retries: 1000
start_period: 10s
fastgpt-mongo:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
restart: always
networks:
- data
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- fastgpt-mongo:/data/db
healthcheck:
test:
[
"CMD",
"mongo",
"-u",
"myusername",
"-p",
"mypassword",
"--authenticationDatabase",
"admin",
"--eval",
"db.adminCommand('ping')",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "fastgpt-mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
fastgpt-redis:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/redis:7.2-alpine
container_name: fastgpt-redis
networks:
- data
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ["CMD", "redis-cli", "-a", "mypassword", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- fastgpt-redis:/data
fastgpt-minio:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- data
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
- data
- app
- codesandbox
- aiproxy
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-redis:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
fastgpt-code-sandbox:
condition: service_healthy
fastgpt-plugin:
condition: service_healthy
restart: always
environment:
# 完整变量请参考: https://github.com/labring/FastGPT/blob/main/projects/app/.env.template
<<:
[
*x-share-db-config,
*x-vec-config,
*x-log-config,
*x-no-proxy-config,
*x-fastgpt-service-config,
*x-agent-sandbox-config,
*x-service-env-config,
*x-app-env-config,
]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
security_opt:
- no-new-privileges:true
environment:
<<: [*x-log-config, *x-no-proxy-config]
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
SANDBOX_TOKEN: *x-code-sandbox-token
# ===== Resource Limits =====
# Maximum API JSON body size (MB), including variables
SANDBOX_API_MAX_BODY_MB: 8
# Execution timeout per request (ms)
SANDBOX_MAX_TIMEOUT: 60000
# Maximum allowed memory per user code execution (MB)
# Note: System automatically adds 50MB for runtime overhead
# Actual process limit = SANDBOX_MAX_MEMORY_MB + 50MB
SANDBOX_MAX_MEMORY_MB: 256
SANDBOX_MAX_OUTPUT_MB: 10
# Number of requests with the same queueId that may enter execution concurrently. Empty disables queueing.
SANDBOX_QUEUE_ID_CONCURRENCY:
# ===== Process Pool =====
# Number of pre-warmed worker processes (JS + Python)
SANDBOX_POOL_SIZE: 20
# ===== Network Request Limits =====
# Whether to check if the request is to a private network
CHECK_INTERNAL_IP: true
# Maximum number of HTTP requests per execution
SANDBOX_REQUEST_MAX_COUNT: 30
# Timeout for each outbound HTTP request (ms)
SANDBOX_REQUEST_TIMEOUT: 60000
# Maximum response body size for outbound requests
SANDBOX_REQUEST_MAX_RESPONSE_MB: 10
# Maximum request body size for outbound requests (MB)
SANDBOX_REQUEST_MAX_BODY_MB: 5
# ===== Module Control =====
# JS allowed modules whitelist (comma-separated)
SANDBOX_JS_ALLOWED_MODULES: lodash,dayjs,moment,uuid,crypto-js,qs,url,querystring
# Python allowed modules whitelist (comma-separated)
SANDBOX_PYTHON_ALLOWED_MODULES: math,cmath,decimal,fractions,random,statistics,collections,array,heapq,bisect,queue,copy,itertools,functools,operator,string,re,difflib,textwrap,unicodedata,codecs,datetime,time,calendar,_strptime,json,csv,base64,binascii,struct,hashlib,hmac,secrets,uuid,typing,abc,enum,dataclasses,contextlib,pprint,weakref,numpy,pandas,matplotlib
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) throw new Error(String(res.status)); })",
]
interval: 30s
timeout: 20s
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
- 3003:3000
restart: always
environment:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
- data
- app
environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
# v4.15 plugin 服务使用独立数据库,避免和 FastGPT 主库集合冲突。
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
# 传递给 OTLP 收集器的服务名称
LOG_OTEL_SERVICE_NAME: fastgpt-plugin
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 20s
retries: 3
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
fastgpt-aiproxy-pg:
condition: service_healthy
networks:
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@fastgpt-aiproxy-pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
DISABLE_MODEL_CONFIG: true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
interval: 5s
timeout: 5s
retries: 10
fastgpt-aiproxy-pg:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:0.8.0-pg15 # docker hub
restart: unless-stopped
container_name: fastgpt-aiproxy-pg
volumes:
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
environment:
TZ: Asia/Shanghai
POSTGRES_USER: postgres
POSTGRES_DB: aiproxy
POSTGRES_PASSWORD: aiproxy
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
interval: 5s
timeout: 5s
retries: 10
networks:
data:
name: fastgpt_data
vector:
name: fastgpt_vector
app:
name: fastgpt_app
codesandbox:
name: fastgpt_codesandbox
aiproxy:
name: fastgpt_aiproxy
volumes:
fastgpt-pg:
fastgpt-mongo:
fastgpt-redis:
fastgpt-minio:
fastgpt-milvus-minio:
fastgpt-milvus-etcd:
fastgpt-milvus-data:
fastgpt-ob-data:
fastgpt-ob-config:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
init_sql:
name: init_sql
content: |
ALTER SYSTEM SET ob_vector_memory_limit_percentage = 30;
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw "1234"
# 系统最高密钥凭证
x-system-key: &x-system-key "fastgpt-xxx"
# 用户登录 JWT 密钥
x-token-key: &x-token-key "fastgpt"
# 文件阅读 token 密钥
x-file-token-key: &x-file-token-key "filetokenkey"
# 密钥加密 key
x-aes256-secret-key: &x-aes256-secret-key "fastgptsecret"
# Invoke 反向调用 JWT 密钥,至少 32 位
x-invoke-token-secret: &x-invoke-token-secret "fastgpt_invoke_token_secret_32_chars_min"
# plugin auth token,v4.15 plugin 服务要求至少 32 位
x-plugin-auth-token: &x-plugin-auth-token "fastgpt-plugin-token-please-change"
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token "codesandbox"
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token "vmtoken"
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"
# aiproxy token
x-aiproxy-token: &x-aiproxy-token "token"
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@fastgpt-redis:6379
# @see https://doc.fastgpt.cn/self-host/config/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_CDN_ENDPOINT:
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATH:
# Log 配置
x-log-config: &x-log-config
LOG_ENABLE_CONSOLE: true
LOG_CONSOLE_LEVEL: debug
LOG_ENABLE_OTEL: false
LOG_OTEL_LEVEL: info
LOG_OTEL_URL: http://localhost:4318/v1/logs
LOG_OTEL_SERVICE_NAME: fastgpt-client
METRICS_ENABLE_OTEL: false
METRICS_OTEL_URL: http://localhost:4318/v1/metrics
METRICS_OTEL_SERVICE_NAME: fastgpt-client
TRACING_ENABLE_OTEL: false
TRACING_OTEL_URL: http://localhost:4318/v1/traces
TRACING_OTEL_SERVICE_NAME: fastgpt-client
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的服务地址配置
x-fastgpt-service-config: &x-fastgpt-service-config
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
CODE_SANDBOX_URL: http://fastgpt-code-sandbox:3000
CODE_SANDBOX_TOKEN: *x-code-sandbox-token
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
AIPROXY_API_TOKEN: *x-aiproxy-token
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的地址。启用 Agent/Skill 沙盒时,必须改成单独部署的 proxy 的 ws:// 或 wss:// 地址。
AGENT_SANDBOX_PROXY_URL:
AGENT_SANDBOX_OPENSANDBOX_BASEURL:
AGENT_SANDBOX_OPENSANDBOX_API_KEY:
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG: v0.2.0
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
DEFAULT_ROOT_PSW: *x-default-root-psw
SYSTEM_NAME: FastGPT
SYSTEM_DESCRIPTION:
SYSTEM_FAVICON:
SSE_MCP_SERVER_PROXY_ENDPOINT:
MARKETPLACE_URL: https://v2.marketplace.fastgpt.cn
PASSWORD_EXPIRED_MONTH:
SHOW_COUPON: false
SHOW_DISCOUNT_COUPON: false
HIDE_CHAT_COPYRIGHT_SETTING:
CHINESE_IP_REDIRECT_URL:
PAY_FORM_URL:
AGENT_SANDBOX_FREE_TIP: false
OPENAPI_KEY_MAX_COUNT: 100
# FastGPT 与 Pro 共用环境变量(packages/service/env.ts · serviceEnv)
x-service-env-config: &x-service-env-config
HOSTNAME: 0.0.0.0
NEXT_PUBLIC_BASE_URL:
ROOT_KEY: *x-system-key
DB_MAX_LINK: 5
SYNC_INDEX: true
TOKEN_KEY: *x-token-key
FILE_TOKEN_KEY: *x-file-token-key
AES256_SECRET_KEY: *x-aes256-secret-key
INVOKE_TOKEN_SECRET: *x-invoke-token-secret
MULTIPLE_DATA_TO_BASE64: true
USE_IP_LIMIT: false
CHECK_INTERNAL_IP: false
TRUSTED_PROXY_ENABLE: false
TRUSTED_PROXY_IPS:
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
HELPER_BOT_MODEL: qwen-max
CHAT_TITLE_MODEL:
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 10
PARSE_FILE_TIMEOUT_SECONDS: 600
HTML_TO_MARKDOWN_WORKERS: 10
TEXT_TO_CHUNKS_WORKERS: 10
WORKFLOW_MAX_RUN_TIMES: 500
WORKFLOW_MAX_LOOP_TIMES: 100
WORKFLOW_PARALLEL_MAX_CONCURRENCY: 10
CHAT_MAX_QPM: 5000
SYSTEM_MAX_STRING_LENGTH_M: 100
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
MAX_FOLDER_DEPTH: 4
APP_FOLDER_MAX_AMOUNT: 1000
DATASET_FOLDER_MAX_AMOUNT: 1000
UPLOAD_FILE_MAX_SIZE: 1000
UPLOAD_FILE_MAX_AMOUNT: 1000
LLM_REQUEST_TRACKING_RETENTION_HOURS: 6
MAX_HTML_TRANSFORM_CHARS: 1000000
DATASET_PARSE_MAX_PROCESS: 10
VECTOR_MAX_PROCESS: 10
QA_MAX_PROCESS: 10
VLM_MAX_PROCESS: 10
HNSW_EF_SEARCH: 100
HNSW_MAX_SCAN_TUPLES: 100000
CUSTOM_PDF_PARSE_URL:
CUSTOM_PDF_PARSE_KEY:
DOC2X_KEY:
TEXTIN_APP_ID:
TEXTIN_SECRET_CODE:
CUSTOM_PDF_PARSE_PRICE: 0
FILE_URL_WHITELIST:
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
OPENGAUSS_URL: postgresql://gaussdb:FastGPT@123@fastgpt-vector:5432/fastgpt
services:
fastgpt-vector:
image: opengauss/opengauss:7.0.0-RC1
container_name: fastgpt-opengauss
restart: always
privileged: true
networks:
- data
environment:
# 这里的配置只有首次运行生效。修改后,重启镜像是不会生效的。需要把持久化数据删除再重启,才有效果
- GS_USERNAME=gaussdb # 默认会创建 gaussdb 用户
- GS_PASSWORD=FastGPT@123 # 密码必须包含大写、小写、数字和特殊字符,且长度不少于8位
- GS_DB=fastgpt # 默认会创建 postgres 数据库,这里以 fastgpt 为例
volumes:
- ./opengauss/data:/var/lib/opengauss
healthcheck:
test: ['CMD-SHELL', 'su - omm -c "gsql -d postgres -p 5432 -c \"SELECT 1\""']
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
fastgpt-mongo:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
restart: always
networks:
- data
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- fastgpt-mongo:/data/db
healthcheck:
test:
[
"CMD",
"mongo",
"-u",
"myusername",
"-p",
"mypassword",
"--authenticationDatabase",
"admin",
"--eval",
"db.adminCommand('ping')",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "fastgpt-mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
fastgpt-redis:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/redis:7.2-alpine
container_name: fastgpt-redis
networks:
- data
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ["CMD", "redis-cli", "-a", "mypassword", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- fastgpt-redis:/data
fastgpt-minio:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- data
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
- data
- app
- codesandbox
- aiproxy
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-redis:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
fastgpt-code-sandbox:
condition: service_healthy
fastgpt-plugin:
condition: service_healthy
restart: always
environment:
# 完整变量请参考: https://github.com/labring/FastGPT/blob/main/projects/app/.env.template
<<:
[
*x-share-db-config,
*x-vec-config,
*x-log-config,
*x-no-proxy-config,
*x-fastgpt-service-config,
*x-agent-sandbox-config,
*x-service-env-config,
*x-app-env-config,
]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
security_opt:
- no-new-privileges:true
environment:
<<: [*x-log-config, *x-no-proxy-config]
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
SANDBOX_TOKEN: *x-code-sandbox-token
# ===== Resource Limits =====
# Maximum API JSON body size (MB), including variables
SANDBOX_API_MAX_BODY_MB: 8
# Execution timeout per request (ms)
SANDBOX_MAX_TIMEOUT: 60000
# Maximum allowed memory per user code execution (MB)
# Note: System automatically adds 50MB for runtime overhead
# Actual process limit = SANDBOX_MAX_MEMORY_MB + 50MB
SANDBOX_MAX_MEMORY_MB: 256
SANDBOX_MAX_OUTPUT_MB: 10
# Number of requests with the same queueId that may enter execution concurrently. Empty disables queueing.
SANDBOX_QUEUE_ID_CONCURRENCY:
# ===== Process Pool =====
# Number of pre-warmed worker processes (JS + Python)
SANDBOX_POOL_SIZE: 20
# ===== Network Request Limits =====
# Whether to check if the request is to a private network
CHECK_INTERNAL_IP: true
# Maximum number of HTTP requests per execution
SANDBOX_REQUEST_MAX_COUNT: 30
# Timeout for each outbound HTTP request (ms)
SANDBOX_REQUEST_TIMEOUT: 60000
# Maximum response body size for outbound requests
SANDBOX_REQUEST_MAX_RESPONSE_MB: 10
# Maximum request body size for outbound requests (MB)
SANDBOX_REQUEST_MAX_BODY_MB: 5
# ===== Module Control =====
# JS allowed modules whitelist (comma-separated)
SANDBOX_JS_ALLOWED_MODULES: lodash,dayjs,moment,uuid,crypto-js,qs,url,querystring
# Python allowed modules whitelist (comma-separated)
SANDBOX_PYTHON_ALLOWED_MODULES: math,cmath,decimal,fractions,random,statistics,collections,array,heapq,bisect,queue,copy,itertools,functools,operator,string,re,difflib,textwrap,unicodedata,codecs,datetime,time,calendar,_strptime,json,csv,base64,binascii,struct,hashlib,hmac,secrets,uuid,typing,abc,enum,dataclasses,contextlib,pprint,weakref,numpy,pandas,matplotlib
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) throw new Error(String(res.status)); })",
]
interval: 30s
timeout: 20s
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
- 3003:3000
restart: always
environment:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
- data
- app
environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
# v4.15 plugin 服务使用独立数据库,避免和 FastGPT 主库集合冲突。
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
# 传递给 OTLP 收集器的服务名称
LOG_OTEL_SERVICE_NAME: fastgpt-plugin
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 20s
retries: 3
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
fastgpt-aiproxy-pg:
condition: service_healthy
networks:
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@fastgpt-aiproxy-pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
DISABLE_MODEL_CONFIG: true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
interval: 5s
timeout: 5s
retries: 10
fastgpt-aiproxy-pg:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:0.8.0-pg15 # docker hub
restart: unless-stopped
container_name: fastgpt-aiproxy-pg
volumes:
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
environment:
TZ: Asia/Shanghai
POSTGRES_USER: postgres
POSTGRES_DB: aiproxy
POSTGRES_PASSWORD: aiproxy
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
interval: 5s
timeout: 5s
retries: 10
networks:
data:
name: fastgpt_data
vector:
name: fastgpt_vector
app:
name: fastgpt_app
codesandbox:
name: fastgpt_codesandbox
aiproxy:
name: fastgpt_aiproxy
volumes:
fastgpt-pg:
fastgpt-mongo:
fastgpt-redis:
fastgpt-minio:
fastgpt-milvus-minio:
fastgpt-milvus-etcd:
fastgpt-milvus-data:
fastgpt-ob-data:
fastgpt-ob-config:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw "1234"
# 系统最高密钥凭证
x-system-key: &x-system-key "fastgpt-xxx"
# 用户登录 JWT 密钥
x-token-key: &x-token-key "fastgpt"
# 文件阅读 token 密钥
x-file-token-key: &x-file-token-key "filetokenkey"
# 密钥加密 key
x-aes256-secret-key: &x-aes256-secret-key "fastgptsecret"
# Invoke 反向调用 JWT 密钥,至少 32 位
x-invoke-token-secret: &x-invoke-token-secret "fastgpt_invoke_token_secret_32_chars_min"
# plugin auth token,v4.15 plugin 服务要求至少 32 位
x-plugin-auth-token: &x-plugin-auth-token "fastgpt-plugin-token-please-change"
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token "codesandbox"
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token "vmtoken"
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"
# aiproxy token
x-aiproxy-token: &x-aiproxy-token "token"
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@fastgpt-redis:6379
# @see https://doc.fastgpt.cn/self-host/config/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_CDN_ENDPOINT:
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATH:
# Log 配置
x-log-config: &x-log-config
LOG_ENABLE_CONSOLE: true
LOG_CONSOLE_LEVEL: debug
LOG_ENABLE_OTEL: false
LOG_OTEL_LEVEL: info
LOG_OTEL_URL: http://localhost:4318/v1/logs
LOG_OTEL_SERVICE_NAME: fastgpt-client
METRICS_ENABLE_OTEL: false
METRICS_OTEL_URL: http://localhost:4318/v1/metrics
METRICS_OTEL_SERVICE_NAME: fastgpt-client
TRACING_ENABLE_OTEL: false
TRACING_OTEL_URL: http://localhost:4318/v1/traces
TRACING_OTEL_SERVICE_NAME: fastgpt-client
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的服务地址配置
x-fastgpt-service-config: &x-fastgpt-service-config
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
CODE_SANDBOX_URL: http://fastgpt-code-sandbox:3000
CODE_SANDBOX_TOKEN: *x-code-sandbox-token
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
AIPROXY_API_TOKEN: *x-aiproxy-token
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的地址。启用 Agent/Skill 沙盒时,必须改成单独部署的 proxy 的 ws:// 或 wss:// 地址。
AGENT_SANDBOX_PROXY_URL:
AGENT_SANDBOX_OPENSANDBOX_BASEURL:
AGENT_SANDBOX_OPENSANDBOX_API_KEY:
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG: v0.2.0
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
DEFAULT_ROOT_PSW: *x-default-root-psw
SYSTEM_NAME: FastGPT
SYSTEM_DESCRIPTION:
SYSTEM_FAVICON:
SSE_MCP_SERVER_PROXY_ENDPOINT:
MARKETPLACE_URL: https://v2.marketplace.fastgpt.cn
PASSWORD_EXPIRED_MONTH:
SHOW_COUPON: false
SHOW_DISCOUNT_COUPON: false
HIDE_CHAT_COPYRIGHT_SETTING:
CHINESE_IP_REDIRECT_URL:
PAY_FORM_URL:
AGENT_SANDBOX_FREE_TIP: false
OPENAPI_KEY_MAX_COUNT: 100
# FastGPT 与 Pro 共用环境变量(packages/service/env.ts · serviceEnv)
x-service-env-config: &x-service-env-config
HOSTNAME: 0.0.0.0
NEXT_PUBLIC_BASE_URL:
ROOT_KEY: *x-system-key
DB_MAX_LINK: 5
SYNC_INDEX: true
TOKEN_KEY: *x-token-key
FILE_TOKEN_KEY: *x-file-token-key
AES256_SECRET_KEY: *x-aes256-secret-key
INVOKE_TOKEN_SECRET: *x-invoke-token-secret
MULTIPLE_DATA_TO_BASE64: true
USE_IP_LIMIT: false
CHECK_INTERNAL_IP: false
TRUSTED_PROXY_ENABLE: false
TRUSTED_PROXY_IPS:
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
HELPER_BOT_MODEL: qwen-max
CHAT_TITLE_MODEL:
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 10
PARSE_FILE_TIMEOUT_SECONDS: 600
HTML_TO_MARKDOWN_WORKERS: 10
TEXT_TO_CHUNKS_WORKERS: 10
WORKFLOW_MAX_RUN_TIMES: 500
WORKFLOW_MAX_LOOP_TIMES: 100
WORKFLOW_PARALLEL_MAX_CONCURRENCY: 10
CHAT_MAX_QPM: 5000
SYSTEM_MAX_STRING_LENGTH_M: 100
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
MAX_FOLDER_DEPTH: 4
APP_FOLDER_MAX_AMOUNT: 1000
DATASET_FOLDER_MAX_AMOUNT: 1000
UPLOAD_FILE_MAX_SIZE: 1000
UPLOAD_FILE_MAX_AMOUNT: 1000
LLM_REQUEST_TRACKING_RETENTION_HOURS: 6
MAX_HTML_TRANSFORM_CHARS: 1000000
DATASET_PARSE_MAX_PROCESS: 10
VECTOR_MAX_PROCESS: 10
QA_MAX_PROCESS: 10
VLM_MAX_PROCESS: 10
HNSW_EF_SEARCH: 100
HNSW_MAX_SCAN_TUPLES: 100000
CUSTOM_PDF_PARSE_URL:
CUSTOM_PDF_PARSE_KEY:
DOC2X_KEY:
TEXTIN_APP_ID:
TEXTIN_SECRET_CODE:
CUSTOM_PDF_PARSE_PRICE: 0
FILE_URL_WHITELIST:
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
PG_URL: postgresql://username:password@fastgpt-vector:5432/postgres
services:
fastgpt-vector:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:0.8.0-pg15
container_name: fastgpt-pg
restart: always
networks:
- data
environment:
# 这里的配置只有首次运行生效。修改后,重启镜像是不会生效的。需要把持久化数据删除再重启,才有效果
- POSTGRES_USER=username
- POSTGRES_PASSWORD=password
- POSTGRES_DB=postgres
volumes:
- fastgpt-pg:/var/lib/postgresql/data
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'username', '-d', 'postgres']
interval: 5s
timeout: 5s
retries: 10
fastgpt-mongo:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
restart: always
networks:
- data
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- fastgpt-mongo:/data/db
healthcheck:
test:
[
"CMD",
"mongo",
"-u",
"myusername",
"-p",
"mypassword",
"--authenticationDatabase",
"admin",
"--eval",
"db.adminCommand('ping')",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "fastgpt-mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
fastgpt-redis:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/redis:7.2-alpine
container_name: fastgpt-redis
networks:
- data
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ["CMD", "redis-cli", "-a", "mypassword", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- fastgpt-redis:/data
fastgpt-minio:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- data
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
- data
- app
- codesandbox
- aiproxy
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-redis:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
fastgpt-code-sandbox:
condition: service_healthy
fastgpt-plugin:
condition: service_healthy
restart: always
environment:
# 完整变量请参考: https://github.com/labring/FastGPT/blob/main/projects/app/.env.template
<<:
[
*x-share-db-config,
*x-vec-config,
*x-log-config,
*x-no-proxy-config,
*x-fastgpt-service-config,
*x-agent-sandbox-config,
*x-service-env-config,
*x-app-env-config,
]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
security_opt:
- no-new-privileges:true
environment:
<<: [*x-log-config, *x-no-proxy-config]
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
SANDBOX_TOKEN: *x-code-sandbox-token
# ===== Resource Limits =====
# Maximum API JSON body size (MB), including variables
SANDBOX_API_MAX_BODY_MB: 8
# Execution timeout per request (ms)
SANDBOX_MAX_TIMEOUT: 60000
# Maximum allowed memory per user code execution (MB)
# Note: System automatically adds 50MB for runtime overhead
# Actual process limit = SANDBOX_MAX_MEMORY_MB + 50MB
SANDBOX_MAX_MEMORY_MB: 256
SANDBOX_MAX_OUTPUT_MB: 10
# Number of requests with the same queueId that may enter execution concurrently. Empty disables queueing.
SANDBOX_QUEUE_ID_CONCURRENCY:
# ===== Process Pool =====
# Number of pre-warmed worker processes (JS + Python)
SANDBOX_POOL_SIZE: 20
# ===== Network Request Limits =====
# Whether to check if the request is to a private network
CHECK_INTERNAL_IP: true
# Maximum number of HTTP requests per execution
SANDBOX_REQUEST_MAX_COUNT: 30
# Timeout for each outbound HTTP request (ms)
SANDBOX_REQUEST_TIMEOUT: 60000
# Maximum response body size for outbound requests
SANDBOX_REQUEST_MAX_RESPONSE_MB: 10
# Maximum request body size for outbound requests (MB)
SANDBOX_REQUEST_MAX_BODY_MB: 5
# ===== Module Control =====
# JS allowed modules whitelist (comma-separated)
SANDBOX_JS_ALLOWED_MODULES: lodash,dayjs,moment,uuid,crypto-js,qs,url,querystring
# Python allowed modules whitelist (comma-separated)
SANDBOX_PYTHON_ALLOWED_MODULES: math,cmath,decimal,fractions,random,statistics,collections,array,heapq,bisect,queue,copy,itertools,functools,operator,string,re,difflib,textwrap,unicodedata,codecs,datetime,time,calendar,_strptime,json,csv,base64,binascii,struct,hashlib,hmac,secrets,uuid,typing,abc,enum,dataclasses,contextlib,pprint,weakref,numpy,pandas,matplotlib
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) throw new Error(String(res.status)); })",
]
interval: 30s
timeout: 20s
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
- 3003:3000
restart: always
environment:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
- data
- app
environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
# v4.15 plugin 服务使用独立数据库,避免和 FastGPT 主库集合冲突。
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
# 传递给 OTLP 收集器的服务名称
LOG_OTEL_SERVICE_NAME: fastgpt-plugin
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 20s
retries: 3
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
fastgpt-aiproxy-pg:
condition: service_healthy
networks:
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@fastgpt-aiproxy-pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
DISABLE_MODEL_CONFIG: true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
interval: 5s
timeout: 5s
retries: 10
fastgpt-aiproxy-pg:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:0.8.0-pg15 # docker hub
restart: unless-stopped
container_name: fastgpt-aiproxy-pg
volumes:
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
environment:
TZ: Asia/Shanghai
POSTGRES_USER: postgres
POSTGRES_DB: aiproxy
POSTGRES_PASSWORD: aiproxy
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
interval: 5s
timeout: 5s
retries: 10
networks:
data:
name: fastgpt_data
vector:
name: fastgpt_vector
app:
name: fastgpt_app
codesandbox:
name: fastgpt_codesandbox
aiproxy:
name: fastgpt_aiproxy
volumes:
fastgpt-pg:
fastgpt-mongo:
fastgpt-redis:
fastgpt-minio:
fastgpt-milvus-minio:
fastgpt-milvus-etcd:
fastgpt-milvus-data:
fastgpt-ob-data:
fastgpt-ob-config:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw "1234"
# 系统最高密钥凭证
x-system-key: &x-system-key "fastgpt-xxx"
# 用户登录 JWT 密钥
x-token-key: &x-token-key "fastgpt"
# 文件阅读 token 密钥
x-file-token-key: &x-file-token-key "filetokenkey"
# 密钥加密 key
x-aes256-secret-key: &x-aes256-secret-key "fastgptsecret"
# Invoke 反向调用 JWT 密钥,至少 32 位
x-invoke-token-secret: &x-invoke-token-secret "fastgpt_invoke_token_secret_32_chars_min"
# plugin auth token,v4.15 plugin 服务要求至少 32 位
x-plugin-auth-token: &x-plugin-auth-token "fastgpt-plugin-token-please-change"
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token "codesandbox"
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token "vmtoken"
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"
# aiproxy token
x-aiproxy-token: &x-aiproxy-token "token"
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@fastgpt-redis:6379
# @see https://doc.fastgpt.cn/self-host/config/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_CDN_ENDPOINT:
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATH:
# Log 配置
x-log-config: &x-log-config
LOG_ENABLE_CONSOLE: true
LOG_CONSOLE_LEVEL: debug
LOG_ENABLE_OTEL: false
LOG_OTEL_LEVEL: info
LOG_OTEL_URL: http://localhost:4318/v1/logs
LOG_OTEL_SERVICE_NAME: fastgpt-client
METRICS_ENABLE_OTEL: false
METRICS_OTEL_URL: http://localhost:4318/v1/metrics
METRICS_OTEL_SERVICE_NAME: fastgpt-client
TRACING_ENABLE_OTEL: false
TRACING_OTEL_URL: http://localhost:4318/v1/traces
TRACING_OTEL_SERVICE_NAME: fastgpt-client
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的服务地址配置
x-fastgpt-service-config: &x-fastgpt-service-config
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
CODE_SANDBOX_URL: http://fastgpt-code-sandbox:3000
CODE_SANDBOX_TOKEN: *x-code-sandbox-token
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
AIPROXY_API_TOKEN: *x-aiproxy-token
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的地址。启用 Agent/Skill 沙盒时,必须改成单独部署的 proxy 的 ws:// 或 wss:// 地址。
AGENT_SANDBOX_PROXY_URL:
AGENT_SANDBOX_OPENSANDBOX_BASEURL:
AGENT_SANDBOX_OPENSANDBOX_API_KEY:
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG: v0.2.0
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
DEFAULT_ROOT_PSW: *x-default-root-psw
SYSTEM_NAME: FastGPT
SYSTEM_DESCRIPTION:
SYSTEM_FAVICON:
SSE_MCP_SERVER_PROXY_ENDPOINT:
MARKETPLACE_URL: https://v2.marketplace.fastgpt.cn
PASSWORD_EXPIRED_MONTH:
SHOW_COUPON: false
SHOW_DISCOUNT_COUPON: false
HIDE_CHAT_COPYRIGHT_SETTING:
CHINESE_IP_REDIRECT_URL:
PAY_FORM_URL:
AGENT_SANDBOX_FREE_TIP: false
OPENAPI_KEY_MAX_COUNT: 100
# FastGPT 与 Pro 共用环境变量(packages/service/env.ts · serviceEnv)
x-service-env-config: &x-service-env-config
HOSTNAME: 0.0.0.0
NEXT_PUBLIC_BASE_URL:
ROOT_KEY: *x-system-key
DB_MAX_LINK: 5
SYNC_INDEX: true
TOKEN_KEY: *x-token-key
FILE_TOKEN_KEY: *x-file-token-key
AES256_SECRET_KEY: *x-aes256-secret-key
INVOKE_TOKEN_SECRET: *x-invoke-token-secret
MULTIPLE_DATA_TO_BASE64: true
USE_IP_LIMIT: false
CHECK_INTERNAL_IP: false
TRUSTED_PROXY_ENABLE: false
TRUSTED_PROXY_IPS:
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
HELPER_BOT_MODEL: qwen-max
CHAT_TITLE_MODEL:
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 10
PARSE_FILE_TIMEOUT_SECONDS: 600
HTML_TO_MARKDOWN_WORKERS: 10
TEXT_TO_CHUNKS_WORKERS: 10
WORKFLOW_MAX_RUN_TIMES: 500
WORKFLOW_MAX_LOOP_TIMES: 100
WORKFLOW_PARALLEL_MAX_CONCURRENCY: 10
CHAT_MAX_QPM: 5000
SYSTEM_MAX_STRING_LENGTH_M: 100
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
MAX_FOLDER_DEPTH: 4
APP_FOLDER_MAX_AMOUNT: 1000
DATASET_FOLDER_MAX_AMOUNT: 1000
UPLOAD_FILE_MAX_SIZE: 1000
UPLOAD_FILE_MAX_AMOUNT: 1000
LLM_REQUEST_TRACKING_RETENTION_HOURS: 6
MAX_HTML_TRANSFORM_CHARS: 1000000
DATASET_PARSE_MAX_PROCESS: 10
VECTOR_MAX_PROCESS: 10
QA_MAX_PROCESS: 10
VLM_MAX_PROCESS: 10
HNSW_EF_SEARCH: 100
HNSW_MAX_SCAN_TUPLES: 100000
CUSTOM_PDF_PARSE_URL:
CUSTOM_PDF_PARSE_KEY:
DOC2X_KEY:
TEXTIN_APP_ID:
TEXTIN_SECRET_CODE:
CUSTOM_PDF_PARSE_PRICE: 0
FILE_URL_WHITELIST:
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
SEEKDB_URL: mysql://root:seekdbpassword@fastgpt-vector:2881/mysql
services:
fastgpt-vector:
image: oceanbase/seekdb:1.0.1.0-100000392025122619
container_name: fastgpt-seekdb
restart: always
# ports: # 生产环境建议不要暴露
# - 2881:2881
# - 2886:2886
networks:
- data
environment:
# SeekDB 连接配置(兼容 MySQL 协议)
- ROOT_PASSWORD=seekdbpassword
# MODE分为MINI和NORMAL, 后者会最大程度使用主机资源
- MODE=MINI
volumes:
- fastgpt-seekdb-data:/var/lib/mysql
- fastgpt-seekdb-config:/etc/mysql/conf.d
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h', '127.0.0.1', '-P2881', '-uroot', '-pseekdbpassword']
interval: 30s
timeout: 10s
retries: 1000
start_period: 10s
fastgpt-mongo:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
restart: always
networks:
- data
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- fastgpt-mongo:/data/db
healthcheck:
test:
[
"CMD",
"mongo",
"-u",
"myusername",
"-p",
"mypassword",
"--authenticationDatabase",
"admin",
"--eval",
"db.adminCommand('ping')",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "fastgpt-mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
fastgpt-redis:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/redis:7.2-alpine
container_name: fastgpt-redis
networks:
- data
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ["CMD", "redis-cli", "-a", "mypassword", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- fastgpt-redis:/data
fastgpt-minio:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- data
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
- data
- app
- codesandbox
- aiproxy
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-redis:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
fastgpt-code-sandbox:
condition: service_healthy
fastgpt-plugin:
condition: service_healthy
restart: always
environment:
# 完整变量请参考: https://github.com/labring/FastGPT/blob/main/projects/app/.env.template
<<:
[
*x-share-db-config,
*x-vec-config,
*x-log-config,
*x-no-proxy-config,
*x-fastgpt-service-config,
*x-agent-sandbox-config,
*x-service-env-config,
*x-app-env-config,
]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
security_opt:
- no-new-privileges:true
environment:
<<: [*x-log-config, *x-no-proxy-config]
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
SANDBOX_TOKEN: *x-code-sandbox-token
# ===== Resource Limits =====
# Maximum API JSON body size (MB), including variables
SANDBOX_API_MAX_BODY_MB: 8
# Execution timeout per request (ms)
SANDBOX_MAX_TIMEOUT: 60000
# Maximum allowed memory per user code execution (MB)
# Note: System automatically adds 50MB for runtime overhead
# Actual process limit = SANDBOX_MAX_MEMORY_MB + 50MB
SANDBOX_MAX_MEMORY_MB: 256
SANDBOX_MAX_OUTPUT_MB: 10
# Number of requests with the same queueId that may enter execution concurrently. Empty disables queueing.
SANDBOX_QUEUE_ID_CONCURRENCY:
# ===== Process Pool =====
# Number of pre-warmed worker processes (JS + Python)
SANDBOX_POOL_SIZE: 20
# ===== Network Request Limits =====
# Whether to check if the request is to a private network
CHECK_INTERNAL_IP: true
# Maximum number of HTTP requests per execution
SANDBOX_REQUEST_MAX_COUNT: 30
# Timeout for each outbound HTTP request (ms)
SANDBOX_REQUEST_TIMEOUT: 60000
# Maximum response body size for outbound requests
SANDBOX_REQUEST_MAX_RESPONSE_MB: 10
# Maximum request body size for outbound requests (MB)
SANDBOX_REQUEST_MAX_BODY_MB: 5
# ===== Module Control =====
# JS allowed modules whitelist (comma-separated)
SANDBOX_JS_ALLOWED_MODULES: lodash,dayjs,moment,uuid,crypto-js,qs,url,querystring
# Python allowed modules whitelist (comma-separated)
SANDBOX_PYTHON_ALLOWED_MODULES: math,cmath,decimal,fractions,random,statistics,collections,array,heapq,bisect,queue,copy,itertools,functools,operator,string,re,difflib,textwrap,unicodedata,codecs,datetime,time,calendar,_strptime,json,csv,base64,binascii,struct,hashlib,hmac,secrets,uuid,typing,abc,enum,dataclasses,contextlib,pprint,weakref,numpy,pandas,matplotlib
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) throw new Error(String(res.status)); })",
]
interval: 30s
timeout: 20s
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
- 3003:3000
restart: always
environment:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
- data
- app
environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
# v4.15 plugin 服务使用独立数据库,避免和 FastGPT 主库集合冲突。
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
# 传递给 OTLP 收集器的服务名称
LOG_OTEL_SERVICE_NAME: fastgpt-plugin
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 20s
retries: 3
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
fastgpt-aiproxy-pg:
condition: service_healthy
networks:
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@fastgpt-aiproxy-pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
DISABLE_MODEL_CONFIG: true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
interval: 5s
timeout: 5s
retries: 10
fastgpt-aiproxy-pg:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:0.8.0-pg15 # docker hub
restart: unless-stopped
container_name: fastgpt-aiproxy-pg
volumes:
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
environment:
TZ: Asia/Shanghai
POSTGRES_USER: postgres
POSTGRES_DB: aiproxy
POSTGRES_PASSWORD: aiproxy
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
interval: 5s
timeout: 5s
retries: 10
networks:
data:
name: fastgpt_data
vector:
name: fastgpt_vector
app:
name: fastgpt_app
codesandbox:
name: fastgpt_codesandbox
aiproxy:
name: fastgpt_aiproxy
volumes:
fastgpt-pg:
fastgpt-mongo:
fastgpt-redis:
fastgpt-minio:
fastgpt-milvus-minio:
fastgpt-milvus-etcd:
fastgpt-milvus-data:
fastgpt-ob-data:
fastgpt-ob-config:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw "1234"
# 系统最高密钥凭证
x-system-key: &x-system-key "fastgpt-xxx"
# 用户登录 JWT 密钥
x-token-key: &x-token-key "fastgpt"
# 文件阅读 token 密钥
x-file-token-key: &x-file-token-key "filetokenkey"
# 密钥加密 key
x-aes256-secret-key: &x-aes256-secret-key "fastgptsecret"
# Invoke 反向调用 JWT 密钥,至少 32 位
x-invoke-token-secret: &x-invoke-token-secret "fastgpt_invoke_token_secret_32_chars_min"
# plugin auth token,v4.15 plugin 服务要求至少 32 位
x-plugin-auth-token: &x-plugin-auth-token "fastgpt-plugin-token-please-change"
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token "codesandbox"
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token "vmtoken"
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"
# aiproxy token
x-aiproxy-token: &x-aiproxy-token "token"
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@fastgpt-redis:6379
# @see https://doc.fastgpt.cn/self-host/config/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_CDN_ENDPOINT:
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATH:
# Log 配置
x-log-config: &x-log-config
LOG_ENABLE_CONSOLE: true
LOG_CONSOLE_LEVEL: debug
LOG_ENABLE_OTEL: false
LOG_OTEL_LEVEL: info
LOG_OTEL_URL: http://localhost:4318/v1/logs
LOG_OTEL_SERVICE_NAME: fastgpt-client
METRICS_ENABLE_OTEL: false
METRICS_OTEL_URL: http://localhost:4318/v1/metrics
METRICS_OTEL_SERVICE_NAME: fastgpt-client
TRACING_ENABLE_OTEL: false
TRACING_OTEL_URL: http://localhost:4318/v1/traces
TRACING_OTEL_SERVICE_NAME: fastgpt-client
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的服务地址配置
x-fastgpt-service-config: &x-fastgpt-service-config
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
CODE_SANDBOX_URL: http://fastgpt-code-sandbox:3000
CODE_SANDBOX_TOKEN: *x-code-sandbox-token
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
AIPROXY_API_TOKEN: *x-aiproxy-token
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的地址。启用 Agent/Skill 沙盒时,必须改成单独部署的 proxy 的 ws:// 或 wss:// 地址。
AGENT_SANDBOX_PROXY_URL:
AGENT_SANDBOX_OPENSANDBOX_BASEURL:
AGENT_SANDBOX_OPENSANDBOX_API_KEY:
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG: v0.2.0
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
DEFAULT_ROOT_PSW: *x-default-root-psw
SYSTEM_NAME: FastGPT
SYSTEM_DESCRIPTION:
SYSTEM_FAVICON:
SSE_MCP_SERVER_PROXY_ENDPOINT:
MARKETPLACE_URL: https://v2.marketplace.fastgpt.cn
PASSWORD_EXPIRED_MONTH:
SHOW_COUPON: false
SHOW_DISCOUNT_COUPON: false
HIDE_CHAT_COPYRIGHT_SETTING:
CHINESE_IP_REDIRECT_URL:
PAY_FORM_URL:
AGENT_SANDBOX_FREE_TIP: false
OPENAPI_KEY_MAX_COUNT: 100
# FastGPT 与 Pro 共用环境变量(packages/service/env.ts · serviceEnv)
x-service-env-config: &x-service-env-config
HOSTNAME: 0.0.0.0
NEXT_PUBLIC_BASE_URL:
ROOT_KEY: *x-system-key
DB_MAX_LINK: 5
SYNC_INDEX: true
TOKEN_KEY: *x-token-key
FILE_TOKEN_KEY: *x-file-token-key
AES256_SECRET_KEY: *x-aes256-secret-key
INVOKE_TOKEN_SECRET: *x-invoke-token-secret
MULTIPLE_DATA_TO_BASE64: true
USE_IP_LIMIT: false
CHECK_INTERNAL_IP: false
TRUSTED_PROXY_ENABLE: false
TRUSTED_PROXY_IPS:
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
HELPER_BOT_MODEL: qwen-max
CHAT_TITLE_MODEL:
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 10
PARSE_FILE_TIMEOUT_SECONDS: 600
HTML_TO_MARKDOWN_WORKERS: 10
TEXT_TO_CHUNKS_WORKERS: 10
WORKFLOW_MAX_RUN_TIMES: 500
WORKFLOW_MAX_LOOP_TIMES: 100
WORKFLOW_PARALLEL_MAX_CONCURRENCY: 10
CHAT_MAX_QPM: 5000
SYSTEM_MAX_STRING_LENGTH_M: 100
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
MAX_FOLDER_DEPTH: 4
APP_FOLDER_MAX_AMOUNT: 1000
DATASET_FOLDER_MAX_AMOUNT: 1000
UPLOAD_FILE_MAX_SIZE: 1000
UPLOAD_FILE_MAX_AMOUNT: 1000
LLM_REQUEST_TRACKING_RETENTION_HOURS: 6
MAX_HTML_TRANSFORM_CHARS: 1000000
DATASET_PARSE_MAX_PROCESS: 10
VECTOR_MAX_PROCESS: 10
QA_MAX_PROCESS: 10
VLM_MAX_PROCESS: 10
HNSW_EF_SEARCH: 100
HNSW_MAX_SCAN_TUPLES: 100000
CUSTOM_PDF_PARSE_URL:
CUSTOM_PDF_PARSE_KEY:
DOC2X_KEY:
TEXTIN_APP_ID:
TEXTIN_SECRET_CODE:
CUSTOM_PDF_PARSE_PRICE: 0
FILE_URL_WHITELIST:
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
MILVUS_ADDRESS: zilliz_cloud_address
MILVUS_TOKEN: zilliz_cloud_token
services:
fastgpt-mongo:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
restart: always
networks:
- data
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- fastgpt-mongo:/data/db
healthcheck:
test:
[
"CMD",
"mongo",
"-u",
"myusername",
"-p",
"mypassword",
"--authenticationDatabase",
"admin",
"--eval",
"db.adminCommand('ping')",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "fastgpt-mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
fastgpt-redis:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/redis:7.2-alpine
container_name: fastgpt-redis
networks:
- data
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ["CMD", "redis-cli", "-a", "mypassword", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- fastgpt-redis:/data
fastgpt-minio:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- data
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
- data
- app
- codesandbox
- aiproxy
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-redis:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
fastgpt-code-sandbox:
condition: service_healthy
fastgpt-plugin:
condition: service_healthy
restart: always
environment:
# 完整变量请参考: https://github.com/labring/FastGPT/blob/main/projects/app/.env.template
<<:
[
*x-share-db-config,
*x-vec-config,
*x-log-config,
*x-no-proxy-config,
*x-fastgpt-service-config,
*x-agent-sandbox-config,
*x-service-env-config,
*x-app-env-config,
]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
security_opt:
- no-new-privileges:true
environment:
<<: [*x-log-config, *x-no-proxy-config]
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
SANDBOX_TOKEN: *x-code-sandbox-token
# ===== Resource Limits =====
# Maximum API JSON body size (MB), including variables
SANDBOX_API_MAX_BODY_MB: 8
# Execution timeout per request (ms)
SANDBOX_MAX_TIMEOUT: 60000
# Maximum allowed memory per user code execution (MB)
# Note: System automatically adds 50MB for runtime overhead
# Actual process limit = SANDBOX_MAX_MEMORY_MB + 50MB
SANDBOX_MAX_MEMORY_MB: 256
SANDBOX_MAX_OUTPUT_MB: 10
# Number of requests with the same queueId that may enter execution concurrently. Empty disables queueing.
SANDBOX_QUEUE_ID_CONCURRENCY:
# ===== Process Pool =====
# Number of pre-warmed worker processes (JS + Python)
SANDBOX_POOL_SIZE: 20
# ===== Network Request Limits =====
# Whether to check if the request is to a private network
CHECK_INTERNAL_IP: true
# Maximum number of HTTP requests per execution
SANDBOX_REQUEST_MAX_COUNT: 30
# Timeout for each outbound HTTP request (ms)
SANDBOX_REQUEST_TIMEOUT: 60000
# Maximum response body size for outbound requests
SANDBOX_REQUEST_MAX_RESPONSE_MB: 10
# Maximum request body size for outbound requests (MB)
SANDBOX_REQUEST_MAX_BODY_MB: 5
# ===== Module Control =====
# JS allowed modules whitelist (comma-separated)
SANDBOX_JS_ALLOWED_MODULES: lodash,dayjs,moment,uuid,crypto-js,qs,url,querystring
# Python allowed modules whitelist (comma-separated)
SANDBOX_PYTHON_ALLOWED_MODULES: math,cmath,decimal,fractions,random,statistics,collections,array,heapq,bisect,queue,copy,itertools,functools,operator,string,re,difflib,textwrap,unicodedata,codecs,datetime,time,calendar,_strptime,json,csv,base64,binascii,struct,hashlib,hmac,secrets,uuid,typing,abc,enum,dataclasses,contextlib,pprint,weakref,numpy,pandas,matplotlib
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) throw new Error(String(res.status)); })",
]
interval: 30s
timeout: 20s
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
- 3003:3000
restart: always
environment:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
- data
- app
environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
# v4.15 plugin 服务使用独立数据库,避免和 FastGPT 主库集合冲突。
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
# 传递给 OTLP 收集器的服务名称
LOG_OTEL_SERVICE_NAME: fastgpt-plugin
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 20s
retries: 3
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
fastgpt-aiproxy-pg:
condition: service_healthy
networks:
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@fastgpt-aiproxy-pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
DISABLE_MODEL_CONFIG: true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
interval: 5s
timeout: 5s
retries: 10
fastgpt-aiproxy-pg:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:0.8.0-pg15 # docker hub
restart: unless-stopped
container_name: fastgpt-aiproxy-pg
volumes:
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
environment:
TZ: Asia/Shanghai
POSTGRES_USER: postgres
POSTGRES_DB: aiproxy
POSTGRES_PASSWORD: aiproxy
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
interval: 5s
timeout: 5s
retries: 10
networks:
data:
name: fastgpt_data
vector:
name: fastgpt_vector
app:
name: fastgpt_app
codesandbox:
name: fastgpt_codesandbox
aiproxy:
name: fastgpt_aiproxy
volumes:
fastgpt-pg:
fastgpt-mongo:
fastgpt-redis:
fastgpt-minio:
fastgpt-milvus-minio:
fastgpt-milvus-etcd:
fastgpt-milvus-data:
fastgpt-ob-data:
fastgpt-ob-config:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw "1234"
# 系统最高密钥凭证
x-system-key: &x-system-key "fastgpt-xxx"
# 用户登录 JWT 密钥
x-token-key: &x-token-key "fastgpt"
# 文件阅读 token 密钥
x-file-token-key: &x-file-token-key "filetokenkey"
# 密钥加密 key
x-aes256-secret-key: &x-aes256-secret-key "fastgptsecret"
# Invoke 反向调用 JWT 密钥,至少 32 位
x-invoke-token-secret: &x-invoke-token-secret "fastgpt_invoke_token_secret_32_chars_min"
# plugin auth token,v4.15 plugin 服务要求至少 32 位
x-plugin-auth-token: &x-plugin-auth-token "fastgpt-plugin-token-please-change"
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token "codesandbox"
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token "vmtoken"
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"
# aiproxy token
x-aiproxy-token: &x-aiproxy-token "token"
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@fastgpt-redis:6379
# @see https://doc.fastgpt.cn/self-host/config/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_CDN_ENDPOINT:
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATH:
# Log 配置
x-log-config: &x-log-config
LOG_ENABLE_CONSOLE: true
LOG_CONSOLE_LEVEL: debug
LOG_ENABLE_OTEL: false
LOG_OTEL_LEVEL: info
LOG_OTEL_URL: http://localhost:4318/v1/logs
LOG_OTEL_SERVICE_NAME: fastgpt-client
METRICS_ENABLE_OTEL: false
METRICS_OTEL_URL: http://localhost:4318/v1/metrics
METRICS_OTEL_SERVICE_NAME: fastgpt-client
TRACING_ENABLE_OTEL: false
TRACING_OTEL_URL: http://localhost:4318/v1/traces
TRACING_OTEL_SERVICE_NAME: fastgpt-client
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的服务地址配置
x-fastgpt-service-config: &x-fastgpt-service-config
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
CODE_SANDBOX_URL: http://fastgpt-code-sandbox:3000
CODE_SANDBOX_TOKEN: *x-code-sandbox-token
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
AIPROXY_API_TOKEN: *x-aiproxy-token
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的地址。启用 Agent/Skill 沙盒时,必须改成单独部署的 proxy 的 ws:// 或 wss:// 地址。
AGENT_SANDBOX_PROXY_URL:
AGENT_SANDBOX_OPENSANDBOX_BASEURL:
AGENT_SANDBOX_OPENSANDBOX_API_KEY:
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO: ghcr.io/labring/fastgpt-agent-sandbox
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG: v0.2.0
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE: ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
DEFAULT_ROOT_PSW: *x-default-root-psw
SYSTEM_NAME: FastGPT
SYSTEM_DESCRIPTION:
SYSTEM_FAVICON:
SSE_MCP_SERVER_PROXY_ENDPOINT:
MARKETPLACE_URL: https://v2.marketplace.fastgpt.cn
PASSWORD_EXPIRED_MONTH:
SHOW_COUPON: false
SHOW_DISCOUNT_COUPON: false
HIDE_CHAT_COPYRIGHT_SETTING:
CHINESE_IP_REDIRECT_URL:
PAY_FORM_URL:
AGENT_SANDBOX_FREE_TIP: false
OPENAPI_KEY_MAX_COUNT: 100
# FastGPT 与 Pro 共用环境变量(packages/service/env.ts · serviceEnv)
x-service-env-config: &x-service-env-config
HOSTNAME: 0.0.0.0
NEXT_PUBLIC_BASE_URL:
ROOT_KEY: *x-system-key
DB_MAX_LINK: 5
SYNC_INDEX: true
TOKEN_KEY: *x-token-key
FILE_TOKEN_KEY: *x-file-token-key
AES256_SECRET_KEY: *x-aes256-secret-key
INVOKE_TOKEN_SECRET: *x-invoke-token-secret
MULTIPLE_DATA_TO_BASE64: true
USE_IP_LIMIT: false
CHECK_INTERNAL_IP: false
TRUSTED_PROXY_ENABLE: false
TRUSTED_PROXY_IPS:
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
HELPER_BOT_MODEL: qwen-max
CHAT_TITLE_MODEL:
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 10
PARSE_FILE_TIMEOUT_SECONDS: 600
HTML_TO_MARKDOWN_WORKERS: 10
TEXT_TO_CHUNKS_WORKERS: 10
WORKFLOW_MAX_RUN_TIMES: 500
WORKFLOW_MAX_LOOP_TIMES: 100
WORKFLOW_PARALLEL_MAX_CONCURRENCY: 10
CHAT_MAX_QPM: 5000
SYSTEM_MAX_STRING_LENGTH_M: 100
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
MAX_FOLDER_DEPTH: 4
APP_FOLDER_MAX_AMOUNT: 1000
DATASET_FOLDER_MAX_AMOUNT: 1000
UPLOAD_FILE_MAX_SIZE: 1000
UPLOAD_FILE_MAX_AMOUNT: 1000
LLM_REQUEST_TRACKING_RETENTION_HOURS: 6
MAX_HTML_TRANSFORM_CHARS: 1000000
DATASET_PARSE_MAX_PROCESS: 10
VECTOR_MAX_PROCESS: 10
QA_MAX_PROCESS: 10
VLM_MAX_PROCESS: 10
HNSW_EF_SEARCH: 100
HNSW_MAX_SCAN_TUPLES: 100000
CUSTOM_PDF_PARSE_URL:
CUSTOM_PDF_PARSE_KEY:
DOC2X_KEY:
TEXTIN_APP_ID:
TEXTIN_SECRET_CODE:
CUSTOM_PDF_PARSE_PRICE: 0
FILE_URL_WHITELIST:
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
MILVUS_ADDRESS: http://fastgpt-vector:19530
MILVUS_TOKEN: none
services:
fastgpt-milvus-minio:
container_name: fastgpt-milvus-minio
image: minio/minio:RELEASE.2023-03-20T20-16-18Z
environment:
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
networks:
- vector
volumes:
- fastgpt-milvus-minio:/minio_data
command: minio server /minio_data --console-address ":9001"
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 30s
timeout: 20s
retries: 3
# milvus
fastgpt-milvus-etcd:
container_name: fastgpt-milvus-etcd
image: quay.io/coreos/etcd:v3.5.5
environment:
- ETCD_AUTO_COMPACTION_MODE=revision
- ETCD_AUTO_COMPACTION_RETENTION=1000
- ETCD_QUOTA_BACKEND_BYTES=4294967296
- ETCD_SNAPSHOT_COUNT=50000
networks:
- vector
volumes:
- fastgpt-milvus-etcd:/etcd
command: etcd -advertise-client-urls=http://127.0.0.1:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
healthcheck:
test: ['CMD', 'etcdctl', 'endpoint', 'health']
interval: 30s
timeout: 20s
retries: 3
fastgpt-vector:
container_name: fastgpt-milvus-standalone
image: milvusdb/milvus:v2.4.3
command: ['milvus', 'run', 'standalone']
security_opt:
- seccomp:unconfined
environment:
ETCD_ENDPOINTS: fastgpt-milvus-etcd:2379
MINIO_ADDRESS: fastgpt-milvus-minio:9000
networks:
- data
volumes:
- fastgpt-milvus-data:/var/lib/milvus
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9091/healthz']
interval: 30s
start_period: 90s
timeout: 20s
retries: 3
depends_on:
- 'fastgpt-milvus-etcd'
- 'fastgpt-milvus-minio'
fastgpt-mongo:
image: mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
restart: always
networks:
- data
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- fastgpt-mongo:/data/db
healthcheck:
test:
[
"CMD",
"mongo",
"-u",
"myusername",
"-p",
"mypassword",
"--authenticationDatabase",
"admin",
"--eval",
"db.adminCommand('ping')",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "fastgpt-mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
fastgpt-redis:
image: redis:7.2-alpine
container_name: fastgpt-redis
networks:
- data
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ["CMD", "redis-cli", "-a", "mypassword", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- fastgpt-redis:/data
fastgpt-minio:
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- data
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
- data
- app
- codesandbox
- aiproxy
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-redis:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
fastgpt-code-sandbox:
condition: service_healthy
fastgpt-plugin:
condition: service_healthy
restart: always
environment:
# 完整变量请参考: https://github.com/labring/FastGPT/blob/main/projects/app/.env.template
<<:
[
*x-share-db-config,
*x-vec-config,
*x-log-config,
*x-no-proxy-config,
*x-fastgpt-service-config,
*x-agent-sandbox-config,
*x-service-env-config,
*x-app-env-config,
]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
security_opt:
- no-new-privileges:true
environment:
<<: [*x-log-config, *x-no-proxy-config]
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
SANDBOX_TOKEN: *x-code-sandbox-token
# ===== Resource Limits =====
# Maximum API JSON body size (MB), including variables
SANDBOX_API_MAX_BODY_MB: 8
# Execution timeout per request (ms)
SANDBOX_MAX_TIMEOUT: 60000
# Maximum allowed memory per user code execution (MB)
# Note: System automatically adds 50MB for runtime overhead
# Actual process limit = SANDBOX_MAX_MEMORY_MB + 50MB
SANDBOX_MAX_MEMORY_MB: 256
SANDBOX_MAX_OUTPUT_MB: 10
# Number of requests with the same queueId that may enter execution concurrently. Empty disables queueing.
SANDBOX_QUEUE_ID_CONCURRENCY:
# ===== Process Pool =====
# Number of pre-warmed worker processes (JS + Python)
SANDBOX_POOL_SIZE: 20
# ===== Network Request Limits =====
# Whether to check if the request is to a private network
CHECK_INTERNAL_IP: true
# Maximum number of HTTP requests per execution
SANDBOX_REQUEST_MAX_COUNT: 30
# Timeout for each outbound HTTP request (ms)
SANDBOX_REQUEST_TIMEOUT: 60000
# Maximum response body size for outbound requests
SANDBOX_REQUEST_MAX_RESPONSE_MB: 10
# Maximum request body size for outbound requests (MB)
SANDBOX_REQUEST_MAX_BODY_MB: 5
# ===== Module Control =====
# JS allowed modules whitelist (comma-separated)
SANDBOX_JS_ALLOWED_MODULES: lodash,dayjs,moment,uuid,crypto-js,qs,url,querystring
# Python allowed modules whitelist (comma-separated)
SANDBOX_PYTHON_ALLOWED_MODULES: math,cmath,decimal,fractions,random,statistics,collections,array,heapq,bisect,queue,copy,itertools,functools,operator,string,re,difflib,textwrap,unicodedata,codecs,datetime,time,calendar,_strptime,json,csv,base64,binascii,struct,hashlib,hmac,secrets,uuid,typing,abc,enum,dataclasses,contextlib,pprint,weakref,numpy,pandas,matplotlib
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) throw new Error(String(res.status)); })",
]
interval: 30s
timeout: 20s
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
- 3003:3000
restart: always
environment:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
- data
- app
environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
# v4.15 plugin 服务使用独立数据库,避免和 FastGPT 主库集合冲突。
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
# 传递给 OTLP 收集器的服务名称
LOG_OTEL_SERVICE_NAME: fastgpt-plugin
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 20s
retries: 3
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
fastgpt-aiproxy-pg:
condition: service_healthy
networks:
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@fastgpt-aiproxy-pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
DISABLE_MODEL_CONFIG: true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
interval: 5s
timeout: 5s
retries: 10
fastgpt-aiproxy-pg:
image: pgvector/pgvector:0.8.0-pg15 # docker hub
restart: unless-stopped
container_name: fastgpt-aiproxy-pg
volumes:
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
environment:
TZ: Asia/Shanghai
POSTGRES_USER: postgres
POSTGRES_DB: aiproxy
POSTGRES_PASSWORD: aiproxy
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
interval: 5s
timeout: 5s
retries: 10
networks:
data:
name: fastgpt_data
vector:
name: fastgpt_vector
app:
name: fastgpt_app
codesandbox:
name: fastgpt_codesandbox
aiproxy:
name: fastgpt_aiproxy
volumes:
fastgpt-pg:
fastgpt-mongo:
fastgpt-redis:
fastgpt-minio:
fastgpt-milvus-minio:
fastgpt-milvus-etcd:
fastgpt-milvus-data:
fastgpt-ob-data:
fastgpt-ob-config:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw "1234"
# 系统最高密钥凭证
x-system-key: &x-system-key "fastgpt-xxx"
# 用户登录 JWT 密钥
x-token-key: &x-token-key "fastgpt"
# 文件阅读 token 密钥
x-file-token-key: &x-file-token-key "filetokenkey"
# 密钥加密 key
x-aes256-secret-key: &x-aes256-secret-key "fastgptsecret"
# Invoke 反向调用 JWT 密钥,至少 32 位
x-invoke-token-secret: &x-invoke-token-secret "fastgpt_invoke_token_secret_32_chars_min"
# plugin auth token,v4.15 plugin 服务要求至少 32 位
x-plugin-auth-token: &x-plugin-auth-token "fastgpt-plugin-token-please-change"
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token "codesandbox"
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token "vmtoken"
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"
# aiproxy token
x-aiproxy-token: &x-aiproxy-token "token"
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@fastgpt-redis:6379
# @see https://doc.fastgpt.cn/self-host/config/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_CDN_ENDPOINT:
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATH:
# Log 配置
x-log-config: &x-log-config
LOG_ENABLE_CONSOLE: true
LOG_CONSOLE_LEVEL: debug
LOG_ENABLE_OTEL: false
LOG_OTEL_LEVEL: info
LOG_OTEL_URL: http://localhost:4318/v1/logs
LOG_OTEL_SERVICE_NAME: fastgpt-client
METRICS_ENABLE_OTEL: false
METRICS_OTEL_URL: http://localhost:4318/v1/metrics
METRICS_OTEL_SERVICE_NAME: fastgpt-client
TRACING_ENABLE_OTEL: false
TRACING_OTEL_URL: http://localhost:4318/v1/traces
TRACING_OTEL_SERVICE_NAME: fastgpt-client
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的服务地址配置
x-fastgpt-service-config: &x-fastgpt-service-config
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
CODE_SANDBOX_URL: http://fastgpt-code-sandbox:3000
CODE_SANDBOX_TOKEN: *x-code-sandbox-token
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
AIPROXY_API_TOKEN: *x-aiproxy-token
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的地址。启用 Agent/Skill 沙盒时,必须改成单独部署的 proxy 的 ws:// 或 wss:// 地址。
AGENT_SANDBOX_PROXY_URL:
AGENT_SANDBOX_OPENSANDBOX_BASEURL:
AGENT_SANDBOX_OPENSANDBOX_API_KEY:
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO: ghcr.io/labring/fastgpt-agent-sandbox
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG: v0.2.0
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE: ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
DEFAULT_ROOT_PSW: *x-default-root-psw
SYSTEM_NAME: FastGPT
SYSTEM_DESCRIPTION:
SYSTEM_FAVICON:
SSE_MCP_SERVER_PROXY_ENDPOINT:
MARKETPLACE_URL: https://v2.marketplace.fastgpt.cn
PASSWORD_EXPIRED_MONTH:
SHOW_COUPON: false
SHOW_DISCOUNT_COUPON: false
HIDE_CHAT_COPYRIGHT_SETTING:
CHINESE_IP_REDIRECT_URL:
PAY_FORM_URL:
AGENT_SANDBOX_FREE_TIP: false
OPENAPI_KEY_MAX_COUNT: 100
# FastGPT 与 Pro 共用环境变量(packages/service/env.ts · serviceEnv)
x-service-env-config: &x-service-env-config
HOSTNAME: 0.0.0.0
NEXT_PUBLIC_BASE_URL:
ROOT_KEY: *x-system-key
DB_MAX_LINK: 5
SYNC_INDEX: true
TOKEN_KEY: *x-token-key
FILE_TOKEN_KEY: *x-file-token-key
AES256_SECRET_KEY: *x-aes256-secret-key
INVOKE_TOKEN_SECRET: *x-invoke-token-secret
MULTIPLE_DATA_TO_BASE64: true
USE_IP_LIMIT: false
CHECK_INTERNAL_IP: false
TRUSTED_PROXY_ENABLE: false
TRUSTED_PROXY_IPS:
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
HELPER_BOT_MODEL: qwen-max
CHAT_TITLE_MODEL:
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 10
PARSE_FILE_TIMEOUT_SECONDS: 600
HTML_TO_MARKDOWN_WORKERS: 10
TEXT_TO_CHUNKS_WORKERS: 10
WORKFLOW_MAX_RUN_TIMES: 500
WORKFLOW_MAX_LOOP_TIMES: 100
WORKFLOW_PARALLEL_MAX_CONCURRENCY: 10
CHAT_MAX_QPM: 5000
SYSTEM_MAX_STRING_LENGTH_M: 100
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
MAX_FOLDER_DEPTH: 4
APP_FOLDER_MAX_AMOUNT: 1000
DATASET_FOLDER_MAX_AMOUNT: 1000
UPLOAD_FILE_MAX_SIZE: 1000
UPLOAD_FILE_MAX_AMOUNT: 1000
LLM_REQUEST_TRACKING_RETENTION_HOURS: 6
MAX_HTML_TRANSFORM_CHARS: 1000000
DATASET_PARSE_MAX_PROCESS: 10
VECTOR_MAX_PROCESS: 10
QA_MAX_PROCESS: 10
VLM_MAX_PROCESS: 10
HNSW_EF_SEARCH: 100
HNSW_MAX_SCAN_TUPLES: 100000
CUSTOM_PDF_PARSE_URL:
CUSTOM_PDF_PARSE_KEY:
DOC2X_KEY:
TEXTIN_APP_ID:
TEXTIN_SECRET_CODE:
CUSTOM_PDF_PARSE_PRICE: 0
FILE_URL_WHITELIST:
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
OCEANBASE_URL: mysql://root%40tenantname:tenantpassword@fastgpt-vector:2881/mysql
services:
fastgpt-vector:
image: oceanbase/oceanbase-ce:4.3.5-lts
container_name: fastgpt-ob
restart: always
# ports: # 生产环境建议不要暴露
# - 2881:2881
networks:
- data
environment:
# 这里的配置只有首次运行生效。修改后,重启镜像是不会生效的。需要把持久化数据删除再重启,才有效果
- OB_SYS_PASSWORD=obsyspassword
# 不同于传统数据库,OceanBase 数据库的账号包含更多字段,包括用户名、租户名和集群名。经典格式为"用户名@租户名#集群名"
# 比如用mysql客户端连接时,根据本文件的默认配置,应该指定 "-uroot@tenantname"
- OB_TENANT_NAME=tenantname
- OB_TENANT_PASSWORD=tenantpassword
# MODE分为MINI和NORMAL, 后者会最大程度使用主机资源
- MODE=MINI
- OB_SERVER_IP=127.0.0.1
# 更多环境变量配置见oceanbase官方文档: https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000002013494
volumes:
- fastgpt-ob-data:/root/ob
- fastgpt-ob-config:/root/.obd/cluster
configs:
- source: init_sql
target: /root/boot/init.d/init.sql
healthcheck:
# obclient -h127.0.0.1 -P2881 -uroot@tenantname -ptenantpassword -e "SELECT 1;"
test:
[
"CMD-SHELL",
'obclient -h$${OB_SERVER_IP} -P2881 -uroot@$${OB_TENANT_NAME} -p$${OB_TENANT_PASSWORD} -e "SELECT 1;"',
]
interval: 30s
timeout: 10s
retries: 1000
start_period: 10s
fastgpt-mongo:
image: mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
restart: always
networks:
- data
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- fastgpt-mongo:/data/db
healthcheck:
test:
[
"CMD",
"mongo",
"-u",
"myusername",
"-p",
"mypassword",
"--authenticationDatabase",
"admin",
"--eval",
"db.adminCommand('ping')",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "fastgpt-mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
fastgpt-redis:
image: redis:7.2-alpine
container_name: fastgpt-redis
networks:
- data
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ["CMD", "redis-cli", "-a", "mypassword", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- fastgpt-redis:/data
fastgpt-minio:
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- data
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
- data
- app
- codesandbox
- aiproxy
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-redis:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
fastgpt-code-sandbox:
condition: service_healthy
fastgpt-plugin:
condition: service_healthy
restart: always
environment:
# 完整变量请参考: https://github.com/labring/FastGPT/blob/main/projects/app/.env.template
<<:
[
*x-share-db-config,
*x-vec-config,
*x-log-config,
*x-no-proxy-config,
*x-fastgpt-service-config,
*x-agent-sandbox-config,
*x-service-env-config,
*x-app-env-config,
]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
security_opt:
- no-new-privileges:true
environment:
<<: [*x-log-config, *x-no-proxy-config]
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
SANDBOX_TOKEN: *x-code-sandbox-token
# ===== Resource Limits =====
# Maximum API JSON body size (MB), including variables
SANDBOX_API_MAX_BODY_MB: 8
# Execution timeout per request (ms)
SANDBOX_MAX_TIMEOUT: 60000
# Maximum allowed memory per user code execution (MB)
# Note: System automatically adds 50MB for runtime overhead
# Actual process limit = SANDBOX_MAX_MEMORY_MB + 50MB
SANDBOX_MAX_MEMORY_MB: 256
SANDBOX_MAX_OUTPUT_MB: 10
# Number of requests with the same queueId that may enter execution concurrently. Empty disables queueing.
SANDBOX_QUEUE_ID_CONCURRENCY:
# ===== Process Pool =====
# Number of pre-warmed worker processes (JS + Python)
SANDBOX_POOL_SIZE: 20
# ===== Network Request Limits =====
# Whether to check if the request is to a private network
CHECK_INTERNAL_IP: true
# Maximum number of HTTP requests per execution
SANDBOX_REQUEST_MAX_COUNT: 30
# Timeout for each outbound HTTP request (ms)
SANDBOX_REQUEST_TIMEOUT: 60000
# Maximum response body size for outbound requests
SANDBOX_REQUEST_MAX_RESPONSE_MB: 10
# Maximum request body size for outbound requests (MB)
SANDBOX_REQUEST_MAX_BODY_MB: 5
# ===== Module Control =====
# JS allowed modules whitelist (comma-separated)
SANDBOX_JS_ALLOWED_MODULES: lodash,dayjs,moment,uuid,crypto-js,qs,url,querystring
# Python allowed modules whitelist (comma-separated)
SANDBOX_PYTHON_ALLOWED_MODULES: math,cmath,decimal,fractions,random,statistics,collections,array,heapq,bisect,queue,copy,itertools,functools,operator,string,re,difflib,textwrap,unicodedata,codecs,datetime,time,calendar,_strptime,json,csv,base64,binascii,struct,hashlib,hmac,secrets,uuid,typing,abc,enum,dataclasses,contextlib,pprint,weakref,numpy,pandas,matplotlib
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) throw new Error(String(res.status)); })",
]
interval: 30s
timeout: 20s
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
- 3003:3000
restart: always
environment:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
- data
- app
environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
# v4.15 plugin 服务使用独立数据库,避免和 FastGPT 主库集合冲突。
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
# 传递给 OTLP 收集器的服务名称
LOG_OTEL_SERVICE_NAME: fastgpt-plugin
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 20s
retries: 3
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
fastgpt-aiproxy-pg:
condition: service_healthy
networks:
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@fastgpt-aiproxy-pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
DISABLE_MODEL_CONFIG: true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
interval: 5s
timeout: 5s
retries: 10
fastgpt-aiproxy-pg:
image: pgvector/pgvector:0.8.0-pg15 # docker hub
restart: unless-stopped
container_name: fastgpt-aiproxy-pg
volumes:
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
environment:
TZ: Asia/Shanghai
POSTGRES_USER: postgres
POSTGRES_DB: aiproxy
POSTGRES_PASSWORD: aiproxy
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
interval: 5s
timeout: 5s
retries: 10
networks:
data:
name: fastgpt_data
vector:
name: fastgpt_vector
app:
name: fastgpt_app
codesandbox:
name: fastgpt_codesandbox
aiproxy:
name: fastgpt_aiproxy
volumes:
fastgpt-pg:
fastgpt-mongo:
fastgpt-redis:
fastgpt-minio:
fastgpt-milvus-minio:
fastgpt-milvus-etcd:
fastgpt-milvus-data:
fastgpt-ob-data:
fastgpt-ob-config:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
init_sql:
name: init_sql
content: |
ALTER SYSTEM SET ob_vector_memory_limit_percentage = 30;
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw "1234"
# 系统最高密钥凭证
x-system-key: &x-system-key "fastgpt-xxx"
# 用户登录 JWT 密钥
x-token-key: &x-token-key "fastgpt"
# 文件阅读 token 密钥
x-file-token-key: &x-file-token-key "filetokenkey"
# 密钥加密 key
x-aes256-secret-key: &x-aes256-secret-key "fastgptsecret"
# Invoke 反向调用 JWT 密钥,至少 32 位
x-invoke-token-secret: &x-invoke-token-secret "fastgpt_invoke_token_secret_32_chars_min"
# plugin auth token,v4.15 plugin 服务要求至少 32 位
x-plugin-auth-token: &x-plugin-auth-token "fastgpt-plugin-token-please-change"
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token "codesandbox"
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token "vmtoken"
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"
# aiproxy token
x-aiproxy-token: &x-aiproxy-token "token"
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@fastgpt-redis:6379
# @see https://doc.fastgpt.cn/self-host/config/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_CDN_ENDPOINT:
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATH:
# Log 配置
x-log-config: &x-log-config
LOG_ENABLE_CONSOLE: true
LOG_CONSOLE_LEVEL: debug
LOG_ENABLE_OTEL: false
LOG_OTEL_LEVEL: info
LOG_OTEL_URL: http://localhost:4318/v1/logs
LOG_OTEL_SERVICE_NAME: fastgpt-client
METRICS_ENABLE_OTEL: false
METRICS_OTEL_URL: http://localhost:4318/v1/metrics
METRICS_OTEL_SERVICE_NAME: fastgpt-client
TRACING_ENABLE_OTEL: false
TRACING_OTEL_URL: http://localhost:4318/v1/traces
TRACING_OTEL_SERVICE_NAME: fastgpt-client
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的服务地址配置
x-fastgpt-service-config: &x-fastgpt-service-config
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
CODE_SANDBOX_URL: http://fastgpt-code-sandbox:3000
CODE_SANDBOX_TOKEN: *x-code-sandbox-token
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
AIPROXY_API_TOKEN: *x-aiproxy-token
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的地址。启用 Agent/Skill 沙盒时,必须改成单独部署的 proxy 的 ws:// 或 wss:// 地址。
AGENT_SANDBOX_PROXY_URL:
AGENT_SANDBOX_OPENSANDBOX_BASEURL:
AGENT_SANDBOX_OPENSANDBOX_API_KEY:
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO: ghcr.io/labring/fastgpt-agent-sandbox
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG: v0.2.0
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE: ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
DEFAULT_ROOT_PSW: *x-default-root-psw
SYSTEM_NAME: FastGPT
SYSTEM_DESCRIPTION:
SYSTEM_FAVICON:
SSE_MCP_SERVER_PROXY_ENDPOINT:
MARKETPLACE_URL: https://v2.marketplace.fastgpt.cn
PASSWORD_EXPIRED_MONTH:
SHOW_COUPON: false
SHOW_DISCOUNT_COUPON: false
HIDE_CHAT_COPYRIGHT_SETTING:
CHINESE_IP_REDIRECT_URL:
PAY_FORM_URL:
AGENT_SANDBOX_FREE_TIP: false
OPENAPI_KEY_MAX_COUNT: 100
# FastGPT 与 Pro 共用环境变量(packages/service/env.ts · serviceEnv)
x-service-env-config: &x-service-env-config
HOSTNAME: 0.0.0.0
NEXT_PUBLIC_BASE_URL:
ROOT_KEY: *x-system-key
DB_MAX_LINK: 5
SYNC_INDEX: true
TOKEN_KEY: *x-token-key
FILE_TOKEN_KEY: *x-file-token-key
AES256_SECRET_KEY: *x-aes256-secret-key
INVOKE_TOKEN_SECRET: *x-invoke-token-secret
MULTIPLE_DATA_TO_BASE64: true
USE_IP_LIMIT: false
CHECK_INTERNAL_IP: false
TRUSTED_PROXY_ENABLE: false
TRUSTED_PROXY_IPS:
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
HELPER_BOT_MODEL: qwen-max
CHAT_TITLE_MODEL:
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 10
PARSE_FILE_TIMEOUT_SECONDS: 600
HTML_TO_MARKDOWN_WORKERS: 10
TEXT_TO_CHUNKS_WORKERS: 10
WORKFLOW_MAX_RUN_TIMES: 500
WORKFLOW_MAX_LOOP_TIMES: 100
WORKFLOW_PARALLEL_MAX_CONCURRENCY: 10
CHAT_MAX_QPM: 5000
SYSTEM_MAX_STRING_LENGTH_M: 100
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
MAX_FOLDER_DEPTH: 4
APP_FOLDER_MAX_AMOUNT: 1000
DATASET_FOLDER_MAX_AMOUNT: 1000
UPLOAD_FILE_MAX_SIZE: 1000
UPLOAD_FILE_MAX_AMOUNT: 1000
LLM_REQUEST_TRACKING_RETENTION_HOURS: 6
MAX_HTML_TRANSFORM_CHARS: 1000000
DATASET_PARSE_MAX_PROCESS: 10
VECTOR_MAX_PROCESS: 10
QA_MAX_PROCESS: 10
VLM_MAX_PROCESS: 10
HNSW_EF_SEARCH: 100
HNSW_MAX_SCAN_TUPLES: 100000
CUSTOM_PDF_PARSE_URL:
CUSTOM_PDF_PARSE_KEY:
DOC2X_KEY:
TEXTIN_APP_ID:
TEXTIN_SECRET_CODE:
CUSTOM_PDF_PARSE_PRICE: 0
FILE_URL_WHITELIST:
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
OPENGAUSS_URL: postgresql://gaussdb:FastGPT@123@fastgpt-vector:5432/fastgpt
services:
fastgpt-vector:
image: opengauss/opengauss:7.0.0-RC1
container_name: fastgpt-opengauss
restart: always
privileged: true
networks:
- data
environment:
# 这里的配置只有首次运行生效。修改后,重启镜像是不会生效的。需要把持久化数据删除再重启,才有效果
- GS_USERNAME=gaussdb # 默认会创建 gaussdb 用户
- GS_PASSWORD=FastGPT@123 # 密码必须包含大写、小写、数字和特殊字符,且长度不少于8位
- GS_DB=fastgpt # 默认会创建 postgres 数据库,这里以 fastgpt 为例
volumes:
- ./opengauss/data:/var/lib/opengauss
healthcheck:
test: ['CMD-SHELL', 'su - omm -c "gsql -d postgres -p 5432 -c \"SELECT 1\""']
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
fastgpt-mongo:
image: mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
restart: always
networks:
- data
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- fastgpt-mongo:/data/db
healthcheck:
test:
[
"CMD",
"mongo",
"-u",
"myusername",
"-p",
"mypassword",
"--authenticationDatabase",
"admin",
"--eval",
"db.adminCommand('ping')",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "fastgpt-mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
fastgpt-redis:
image: redis:7.2-alpine
container_name: fastgpt-redis
networks:
- data
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ["CMD", "redis-cli", "-a", "mypassword", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- fastgpt-redis:/data
fastgpt-minio:
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- data
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
- data
- app
- codesandbox
- aiproxy
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-redis:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
fastgpt-code-sandbox:
condition: service_healthy
fastgpt-plugin:
condition: service_healthy
restart: always
environment:
# 完整变量请参考: https://github.com/labring/FastGPT/blob/main/projects/app/.env.template
<<:
[
*x-share-db-config,
*x-vec-config,
*x-log-config,
*x-no-proxy-config,
*x-fastgpt-service-config,
*x-agent-sandbox-config,
*x-service-env-config,
*x-app-env-config,
]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
security_opt:
- no-new-privileges:true
environment:
<<: [*x-log-config, *x-no-proxy-config]
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
SANDBOX_TOKEN: *x-code-sandbox-token
# ===== Resource Limits =====
# Maximum API JSON body size (MB), including variables
SANDBOX_API_MAX_BODY_MB: 8
# Execution timeout per request (ms)
SANDBOX_MAX_TIMEOUT: 60000
# Maximum allowed memory per user code execution (MB)
# Note: System automatically adds 50MB for runtime overhead
# Actual process limit = SANDBOX_MAX_MEMORY_MB + 50MB
SANDBOX_MAX_MEMORY_MB: 256
SANDBOX_MAX_OUTPUT_MB: 10
# Number of requests with the same queueId that may enter execution concurrently. Empty disables queueing.
SANDBOX_QUEUE_ID_CONCURRENCY:
# ===== Process Pool =====
# Number of pre-warmed worker processes (JS + Python)
SANDBOX_POOL_SIZE: 20
# ===== Network Request Limits =====
# Whether to check if the request is to a private network
CHECK_INTERNAL_IP: true
# Maximum number of HTTP requests per execution
SANDBOX_REQUEST_MAX_COUNT: 30
# Timeout for each outbound HTTP request (ms)
SANDBOX_REQUEST_TIMEOUT: 60000
# Maximum response body size for outbound requests
SANDBOX_REQUEST_MAX_RESPONSE_MB: 10
# Maximum request body size for outbound requests (MB)
SANDBOX_REQUEST_MAX_BODY_MB: 5
# ===== Module Control =====
# JS allowed modules whitelist (comma-separated)
SANDBOX_JS_ALLOWED_MODULES: lodash,dayjs,moment,uuid,crypto-js,qs,url,querystring
# Python allowed modules whitelist (comma-separated)
SANDBOX_PYTHON_ALLOWED_MODULES: math,cmath,decimal,fractions,random,statistics,collections,array,heapq,bisect,queue,copy,itertools,functools,operator,string,re,difflib,textwrap,unicodedata,codecs,datetime,time,calendar,_strptime,json,csv,base64,binascii,struct,hashlib,hmac,secrets,uuid,typing,abc,enum,dataclasses,contextlib,pprint,weakref,numpy,pandas,matplotlib
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) throw new Error(String(res.status)); })",
]
interval: 30s
timeout: 20s
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
- 3003:3000
restart: always
environment:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
- data
- app
environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
# v4.15 plugin 服务使用独立数据库,避免和 FastGPT 主库集合冲突。
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
# 传递给 OTLP 收集器的服务名称
LOG_OTEL_SERVICE_NAME: fastgpt-plugin
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 20s
retries: 3
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
fastgpt-aiproxy-pg:
condition: service_healthy
networks:
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@fastgpt-aiproxy-pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
DISABLE_MODEL_CONFIG: true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
interval: 5s
timeout: 5s
retries: 10
fastgpt-aiproxy-pg:
image: pgvector/pgvector:0.8.0-pg15 # docker hub
restart: unless-stopped
container_name: fastgpt-aiproxy-pg
volumes:
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
environment:
TZ: Asia/Shanghai
POSTGRES_USER: postgres
POSTGRES_DB: aiproxy
POSTGRES_PASSWORD: aiproxy
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
interval: 5s
timeout: 5s
retries: 10
networks:
data:
name: fastgpt_data
vector:
name: fastgpt_vector
app:
name: fastgpt_app
codesandbox:
name: fastgpt_codesandbox
aiproxy:
name: fastgpt_aiproxy
volumes:
fastgpt-pg:
fastgpt-mongo:
fastgpt-redis:
fastgpt-minio:
fastgpt-milvus-minio:
fastgpt-milvus-etcd:
fastgpt-milvus-data:
fastgpt-ob-data:
fastgpt-ob-config:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw "1234"
# 系统最高密钥凭证
x-system-key: &x-system-key "fastgpt-xxx"
# 用户登录 JWT 密钥
x-token-key: &x-token-key "fastgpt"
# 文件阅读 token 密钥
x-file-token-key: &x-file-token-key "filetokenkey"
# 密钥加密 key
x-aes256-secret-key: &x-aes256-secret-key "fastgptsecret"
# Invoke 反向调用 JWT 密钥,至少 32 位
x-invoke-token-secret: &x-invoke-token-secret "fastgpt_invoke_token_secret_32_chars_min"
# plugin auth token,v4.15 plugin 服务要求至少 32 位
x-plugin-auth-token: &x-plugin-auth-token "fastgpt-plugin-token-please-change"
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token "codesandbox"
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token "vmtoken"
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"
# aiproxy token
x-aiproxy-token: &x-aiproxy-token "token"
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@fastgpt-redis:6379
# @see https://doc.fastgpt.cn/self-host/config/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_CDN_ENDPOINT:
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATH:
# Log 配置
x-log-config: &x-log-config
LOG_ENABLE_CONSOLE: true
LOG_CONSOLE_LEVEL: debug
LOG_ENABLE_OTEL: false
LOG_OTEL_LEVEL: info
LOG_OTEL_URL: http://localhost:4318/v1/logs
LOG_OTEL_SERVICE_NAME: fastgpt-client
METRICS_ENABLE_OTEL: false
METRICS_OTEL_URL: http://localhost:4318/v1/metrics
METRICS_OTEL_SERVICE_NAME: fastgpt-client
TRACING_ENABLE_OTEL: false
TRACING_OTEL_URL: http://localhost:4318/v1/traces
TRACING_OTEL_SERVICE_NAME: fastgpt-client
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的服务地址配置
x-fastgpt-service-config: &x-fastgpt-service-config
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
CODE_SANDBOX_URL: http://fastgpt-code-sandbox:3000
CODE_SANDBOX_TOKEN: *x-code-sandbox-token
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
AIPROXY_API_TOKEN: *x-aiproxy-token
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的地址。启用 Agent/Skill 沙盒时,必须改成单独部署的 proxy 的 ws:// 或 wss:// 地址。
AGENT_SANDBOX_PROXY_URL:
AGENT_SANDBOX_OPENSANDBOX_BASEURL:
AGENT_SANDBOX_OPENSANDBOX_API_KEY:
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO: ghcr.io/labring/fastgpt-agent-sandbox
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG: v0.2.0
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE: ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
DEFAULT_ROOT_PSW: *x-default-root-psw
SYSTEM_NAME: FastGPT
SYSTEM_DESCRIPTION:
SYSTEM_FAVICON:
SSE_MCP_SERVER_PROXY_ENDPOINT:
MARKETPLACE_URL: https://v2.marketplace.fastgpt.cn
PASSWORD_EXPIRED_MONTH:
SHOW_COUPON: false
SHOW_DISCOUNT_COUPON: false
HIDE_CHAT_COPYRIGHT_SETTING:
CHINESE_IP_REDIRECT_URL:
PAY_FORM_URL:
AGENT_SANDBOX_FREE_TIP: false
OPENAPI_KEY_MAX_COUNT: 100
# FastGPT 与 Pro 共用环境变量(packages/service/env.ts · serviceEnv)
x-service-env-config: &x-service-env-config
HOSTNAME: 0.0.0.0
NEXT_PUBLIC_BASE_URL:
ROOT_KEY: *x-system-key
DB_MAX_LINK: 5
SYNC_INDEX: true
TOKEN_KEY: *x-token-key
FILE_TOKEN_KEY: *x-file-token-key
AES256_SECRET_KEY: *x-aes256-secret-key
INVOKE_TOKEN_SECRET: *x-invoke-token-secret
MULTIPLE_DATA_TO_BASE64: true
USE_IP_LIMIT: false
CHECK_INTERNAL_IP: false
TRUSTED_PROXY_ENABLE: false
TRUSTED_PROXY_IPS:
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
HELPER_BOT_MODEL: qwen-max
CHAT_TITLE_MODEL:
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 10
PARSE_FILE_TIMEOUT_SECONDS: 600
HTML_TO_MARKDOWN_WORKERS: 10
TEXT_TO_CHUNKS_WORKERS: 10
WORKFLOW_MAX_RUN_TIMES: 500
WORKFLOW_MAX_LOOP_TIMES: 100
WORKFLOW_PARALLEL_MAX_CONCURRENCY: 10
CHAT_MAX_QPM: 5000
SYSTEM_MAX_STRING_LENGTH_M: 100
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
MAX_FOLDER_DEPTH: 4
APP_FOLDER_MAX_AMOUNT: 1000
DATASET_FOLDER_MAX_AMOUNT: 1000
UPLOAD_FILE_MAX_SIZE: 1000
UPLOAD_FILE_MAX_AMOUNT: 1000
LLM_REQUEST_TRACKING_RETENTION_HOURS: 6
MAX_HTML_TRANSFORM_CHARS: 1000000
DATASET_PARSE_MAX_PROCESS: 10
VECTOR_MAX_PROCESS: 10
QA_MAX_PROCESS: 10
VLM_MAX_PROCESS: 10
HNSW_EF_SEARCH: 100
HNSW_MAX_SCAN_TUPLES: 100000
CUSTOM_PDF_PARSE_URL:
CUSTOM_PDF_PARSE_KEY:
DOC2X_KEY:
TEXTIN_APP_ID:
TEXTIN_SECRET_CODE:
CUSTOM_PDF_PARSE_PRICE: 0
FILE_URL_WHITELIST:
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
PG_URL: postgresql://username:password@fastgpt-vector:5432/postgres
services:
fastgpt-vector:
image: pgvector/pgvector:0.8.0-pg15
container_name: fastgpt-pg
restart: always
networks:
- data
environment:
# 这里的配置只有首次运行生效。修改后,重启镜像是不会生效的。需要把持久化数据删除再重启,才有效果
- POSTGRES_USER=username
- POSTGRES_PASSWORD=password
- POSTGRES_DB=postgres
volumes:
- fastgpt-pg:/var/lib/postgresql/data
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'username', '-d', 'postgres']
interval: 5s
timeout: 5s
retries: 10
fastgpt-mongo:
image: mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
restart: always
networks:
- data
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- fastgpt-mongo:/data/db
healthcheck:
test:
[
"CMD",
"mongo",
"-u",
"myusername",
"-p",
"mypassword",
"--authenticationDatabase",
"admin",
"--eval",
"db.adminCommand('ping')",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "fastgpt-mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
fastgpt-redis:
image: redis:7.2-alpine
container_name: fastgpt-redis
networks:
- data
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ["CMD", "redis-cli", "-a", "mypassword", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- fastgpt-redis:/data
fastgpt-minio:
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- data
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
- data
- app
- codesandbox
- aiproxy
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-redis:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
fastgpt-code-sandbox:
condition: service_healthy
fastgpt-plugin:
condition: service_healthy
restart: always
environment:
# 完整变量请参考: https://github.com/labring/FastGPT/blob/main/projects/app/.env.template
<<:
[
*x-share-db-config,
*x-vec-config,
*x-log-config,
*x-no-proxy-config,
*x-fastgpt-service-config,
*x-agent-sandbox-config,
*x-service-env-config,
*x-app-env-config,
]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
security_opt:
- no-new-privileges:true
environment:
<<: [*x-log-config, *x-no-proxy-config]
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
SANDBOX_TOKEN: *x-code-sandbox-token
# ===== Resource Limits =====
# Maximum API JSON body size (MB), including variables
SANDBOX_API_MAX_BODY_MB: 8
# Execution timeout per request (ms)
SANDBOX_MAX_TIMEOUT: 60000
# Maximum allowed memory per user code execution (MB)
# Note: System automatically adds 50MB for runtime overhead
# Actual process limit = SANDBOX_MAX_MEMORY_MB + 50MB
SANDBOX_MAX_MEMORY_MB: 256
SANDBOX_MAX_OUTPUT_MB: 10
# Number of requests with the same queueId that may enter execution concurrently. Empty disables queueing.
SANDBOX_QUEUE_ID_CONCURRENCY:
# ===== Process Pool =====
# Number of pre-warmed worker processes (JS + Python)
SANDBOX_POOL_SIZE: 20
# ===== Network Request Limits =====
# Whether to check if the request is to a private network
CHECK_INTERNAL_IP: true
# Maximum number of HTTP requests per execution
SANDBOX_REQUEST_MAX_COUNT: 30
# Timeout for each outbound HTTP request (ms)
SANDBOX_REQUEST_TIMEOUT: 60000
# Maximum response body size for outbound requests
SANDBOX_REQUEST_MAX_RESPONSE_MB: 10
# Maximum request body size for outbound requests (MB)
SANDBOX_REQUEST_MAX_BODY_MB: 5
# ===== Module Control =====
# JS allowed modules whitelist (comma-separated)
SANDBOX_JS_ALLOWED_MODULES: lodash,dayjs,moment,uuid,crypto-js,qs,url,querystring
# Python allowed modules whitelist (comma-separated)
SANDBOX_PYTHON_ALLOWED_MODULES: math,cmath,decimal,fractions,random,statistics,collections,array,heapq,bisect,queue,copy,itertools,functools,operator,string,re,difflib,textwrap,unicodedata,codecs,datetime,time,calendar,_strptime,json,csv,base64,binascii,struct,hashlib,hmac,secrets,uuid,typing,abc,enum,dataclasses,contextlib,pprint,weakref,numpy,pandas,matplotlib
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) throw new Error(String(res.status)); })",
]
interval: 30s
timeout: 20s
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
- 3003:3000
restart: always
environment:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
- data
- app
environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
# v4.15 plugin 服务使用独立数据库,避免和 FastGPT 主库集合冲突。
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
# 传递给 OTLP 收集器的服务名称
LOG_OTEL_SERVICE_NAME: fastgpt-plugin
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 20s
retries: 3
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
fastgpt-aiproxy-pg:
condition: service_healthy
networks:
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@fastgpt-aiproxy-pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
DISABLE_MODEL_CONFIG: true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
interval: 5s
timeout: 5s
retries: 10
fastgpt-aiproxy-pg:
image: pgvector/pgvector:0.8.0-pg15 # docker hub
restart: unless-stopped
container_name: fastgpt-aiproxy-pg
volumes:
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
environment:
TZ: Asia/Shanghai
POSTGRES_USER: postgres
POSTGRES_DB: aiproxy
POSTGRES_PASSWORD: aiproxy
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
interval: 5s
timeout: 5s
retries: 10
networks:
data:
name: fastgpt_data
vector:
name: fastgpt_vector
app:
name: fastgpt_app
codesandbox:
name: fastgpt_codesandbox
aiproxy:
name: fastgpt_aiproxy
volumes:
fastgpt-pg:
fastgpt-mongo:
fastgpt-redis:
fastgpt-minio:
fastgpt-milvus-minio:
fastgpt-milvus-etcd:
fastgpt-milvus-data:
fastgpt-ob-data:
fastgpt-ob-config:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw "1234"
# 系统最高密钥凭证
x-system-key: &x-system-key "fastgpt-xxx"
# 用户登录 JWT 密钥
x-token-key: &x-token-key "fastgpt"
# 文件阅读 token 密钥
x-file-token-key: &x-file-token-key "filetokenkey"
# 密钥加密 key
x-aes256-secret-key: &x-aes256-secret-key "fastgptsecret"
# Invoke 反向调用 JWT 密钥,至少 32 位
x-invoke-token-secret: &x-invoke-token-secret "fastgpt_invoke_token_secret_32_chars_min"
# plugin auth token,v4.15 plugin 服务要求至少 32 位
x-plugin-auth-token: &x-plugin-auth-token "fastgpt-plugin-token-please-change"
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token "codesandbox"
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token "vmtoken"
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"
# aiproxy token
x-aiproxy-token: &x-aiproxy-token "token"
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@fastgpt-redis:6379
# @see https://doc.fastgpt.cn/self-host/config/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_CDN_ENDPOINT:
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATH:
# Log 配置
x-log-config: &x-log-config
LOG_ENABLE_CONSOLE: true
LOG_CONSOLE_LEVEL: debug
LOG_ENABLE_OTEL: false
LOG_OTEL_LEVEL: info
LOG_OTEL_URL: http://localhost:4318/v1/logs
LOG_OTEL_SERVICE_NAME: fastgpt-client
METRICS_ENABLE_OTEL: false
METRICS_OTEL_URL: http://localhost:4318/v1/metrics
METRICS_OTEL_SERVICE_NAME: fastgpt-client
TRACING_ENABLE_OTEL: false
TRACING_OTEL_URL: http://localhost:4318/v1/traces
TRACING_OTEL_SERVICE_NAME: fastgpt-client
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的服务地址配置
x-fastgpt-service-config: &x-fastgpt-service-config
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
CODE_SANDBOX_URL: http://fastgpt-code-sandbox:3000
CODE_SANDBOX_TOKEN: *x-code-sandbox-token
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
AIPROXY_API_TOKEN: *x-aiproxy-token
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的地址。启用 Agent/Skill 沙盒时,必须改成单独部署的 proxy 的 ws:// 或 wss:// 地址。
AGENT_SANDBOX_PROXY_URL:
AGENT_SANDBOX_OPENSANDBOX_BASEURL:
AGENT_SANDBOX_OPENSANDBOX_API_KEY:
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO: ghcr.io/labring/fastgpt-agent-sandbox
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG: v0.2.0
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE: ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
DEFAULT_ROOT_PSW: *x-default-root-psw
SYSTEM_NAME: FastGPT
SYSTEM_DESCRIPTION:
SYSTEM_FAVICON:
SSE_MCP_SERVER_PROXY_ENDPOINT:
MARKETPLACE_URL: https://v2.marketplace.fastgpt.cn
PASSWORD_EXPIRED_MONTH:
SHOW_COUPON: false
SHOW_DISCOUNT_COUPON: false
HIDE_CHAT_COPYRIGHT_SETTING:
CHINESE_IP_REDIRECT_URL:
PAY_FORM_URL:
AGENT_SANDBOX_FREE_TIP: false
OPENAPI_KEY_MAX_COUNT: 100
# FastGPT 与 Pro 共用环境变量(packages/service/env.ts · serviceEnv)
x-service-env-config: &x-service-env-config
HOSTNAME: 0.0.0.0
NEXT_PUBLIC_BASE_URL:
ROOT_KEY: *x-system-key
DB_MAX_LINK: 5
SYNC_INDEX: true
TOKEN_KEY: *x-token-key
FILE_TOKEN_KEY: *x-file-token-key
AES256_SECRET_KEY: *x-aes256-secret-key
INVOKE_TOKEN_SECRET: *x-invoke-token-secret
MULTIPLE_DATA_TO_BASE64: true
USE_IP_LIMIT: false
CHECK_INTERNAL_IP: false
TRUSTED_PROXY_ENABLE: false
TRUSTED_PROXY_IPS:
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
HELPER_BOT_MODEL: qwen-max
CHAT_TITLE_MODEL:
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 10
PARSE_FILE_TIMEOUT_SECONDS: 600
HTML_TO_MARKDOWN_WORKERS: 10
TEXT_TO_CHUNKS_WORKERS: 10
WORKFLOW_MAX_RUN_TIMES: 500
WORKFLOW_MAX_LOOP_TIMES: 100
WORKFLOW_PARALLEL_MAX_CONCURRENCY: 10
CHAT_MAX_QPM: 5000
SYSTEM_MAX_STRING_LENGTH_M: 100
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
MAX_FOLDER_DEPTH: 4
APP_FOLDER_MAX_AMOUNT: 1000
DATASET_FOLDER_MAX_AMOUNT: 1000
UPLOAD_FILE_MAX_SIZE: 1000
UPLOAD_FILE_MAX_AMOUNT: 1000
LLM_REQUEST_TRACKING_RETENTION_HOURS: 6
MAX_HTML_TRANSFORM_CHARS: 1000000
DATASET_PARSE_MAX_PROCESS: 10
VECTOR_MAX_PROCESS: 10
QA_MAX_PROCESS: 10
VLM_MAX_PROCESS: 10
HNSW_EF_SEARCH: 100
HNSW_MAX_SCAN_TUPLES: 100000
CUSTOM_PDF_PARSE_URL:
CUSTOM_PDF_PARSE_KEY:
DOC2X_KEY:
TEXTIN_APP_ID:
TEXTIN_SECRET_CODE:
CUSTOM_PDF_PARSE_PRICE: 0
FILE_URL_WHITELIST:
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
SEEKDB_URL: mysql://root:seekdbpassword@fastgpt-vector:2881/mysql
services:
fastgpt-vector:
image: oceanbase/seekdb:1.0.1.0-100000392025122619
container_name: fastgpt-seekdb
restart: always
# ports: # 生产环境建议不要暴露
# - 2881:2881
# - 2886:2886
networks:
- data
environment:
# SeekDB 连接配置(兼容 MySQL 协议)
- ROOT_PASSWORD=seekdbpassword
# MODE分为MINI和NORMAL, 后者会最大程度使用主机资源
- MODE=MINI
volumes:
- fastgpt-seekdb-data:/var/lib/mysql
- fastgpt-seekdb-config:/etc/mysql/conf.d
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h', '127.0.0.1', '-P2881', '-uroot', '-pseekdbpassword']
interval: 30s
timeout: 10s
retries: 1000
start_period: 10s
fastgpt-mongo:
image: mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
restart: always
networks:
- data
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- fastgpt-mongo:/data/db
healthcheck:
test:
[
"CMD",
"mongo",
"-u",
"myusername",
"-p",
"mypassword",
"--authenticationDatabase",
"admin",
"--eval",
"db.adminCommand('ping')",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "fastgpt-mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
fastgpt-redis:
image: redis:7.2-alpine
container_name: fastgpt-redis
networks:
- data
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ["CMD", "redis-cli", "-a", "mypassword", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- fastgpt-redis:/data
fastgpt-minio:
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- data
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
- data
- app
- codesandbox
- aiproxy
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-redis:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
fastgpt-code-sandbox:
condition: service_healthy
fastgpt-plugin:
condition: service_healthy
restart: always
environment:
# 完整变量请参考: https://github.com/labring/FastGPT/blob/main/projects/app/.env.template
<<:
[
*x-share-db-config,
*x-vec-config,
*x-log-config,
*x-no-proxy-config,
*x-fastgpt-service-config,
*x-agent-sandbox-config,
*x-service-env-config,
*x-app-env-config,
]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
security_opt:
- no-new-privileges:true
environment:
<<: [*x-log-config, *x-no-proxy-config]
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
SANDBOX_TOKEN: *x-code-sandbox-token
# ===== Resource Limits =====
# Maximum API JSON body size (MB), including variables
SANDBOX_API_MAX_BODY_MB: 8
# Execution timeout per request (ms)
SANDBOX_MAX_TIMEOUT: 60000
# Maximum allowed memory per user code execution (MB)
# Note: System automatically adds 50MB for runtime overhead
# Actual process limit = SANDBOX_MAX_MEMORY_MB + 50MB
SANDBOX_MAX_MEMORY_MB: 256
SANDBOX_MAX_OUTPUT_MB: 10
# Number of requests with the same queueId that may enter execution concurrently. Empty disables queueing.
SANDBOX_QUEUE_ID_CONCURRENCY:
# ===== Process Pool =====
# Number of pre-warmed worker processes (JS + Python)
SANDBOX_POOL_SIZE: 20
# ===== Network Request Limits =====
# Whether to check if the request is to a private network
CHECK_INTERNAL_IP: true
# Maximum number of HTTP requests per execution
SANDBOX_REQUEST_MAX_COUNT: 30
# Timeout for each outbound HTTP request (ms)
SANDBOX_REQUEST_TIMEOUT: 60000
# Maximum response body size for outbound requests
SANDBOX_REQUEST_MAX_RESPONSE_MB: 10
# Maximum request body size for outbound requests (MB)
SANDBOX_REQUEST_MAX_BODY_MB: 5
# ===== Module Control =====
# JS allowed modules whitelist (comma-separated)
SANDBOX_JS_ALLOWED_MODULES: lodash,dayjs,moment,uuid,crypto-js,qs,url,querystring
# Python allowed modules whitelist (comma-separated)
SANDBOX_PYTHON_ALLOWED_MODULES: math,cmath,decimal,fractions,random,statistics,collections,array,heapq,bisect,queue,copy,itertools,functools,operator,string,re,difflib,textwrap,unicodedata,codecs,datetime,time,calendar,_strptime,json,csv,base64,binascii,struct,hashlib,hmac,secrets,uuid,typing,abc,enum,dataclasses,contextlib,pprint,weakref,numpy,pandas,matplotlib
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) throw new Error(String(res.status)); })",
]
interval: 30s
timeout: 20s
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
- 3003:3000
restart: always
environment:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
- data
- app
environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
# v4.15 plugin 服务使用独立数据库,避免和 FastGPT 主库集合冲突。
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
# 传递给 OTLP 收集器的服务名称
LOG_OTEL_SERVICE_NAME: fastgpt-plugin
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 20s
retries: 3
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
fastgpt-aiproxy-pg:
condition: service_healthy
networks:
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@fastgpt-aiproxy-pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
DISABLE_MODEL_CONFIG: true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
interval: 5s
timeout: 5s
retries: 10
fastgpt-aiproxy-pg:
image: pgvector/pgvector:0.8.0-pg15 # docker hub
restart: unless-stopped
container_name: fastgpt-aiproxy-pg
volumes:
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
environment:
TZ: Asia/Shanghai
POSTGRES_USER: postgres
POSTGRES_DB: aiproxy
POSTGRES_PASSWORD: aiproxy
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
interval: 5s
timeout: 5s
retries: 10
networks:
data:
name: fastgpt_data
vector:
name: fastgpt_vector
app:
name: fastgpt_app
codesandbox:
name: fastgpt_codesandbox
aiproxy:
name: fastgpt_aiproxy
volumes:
fastgpt-pg:
fastgpt-mongo:
fastgpt-redis:
fastgpt-minio:
fastgpt-milvus-minio:
fastgpt-milvus-etcd:
fastgpt-milvus-data:
fastgpt-ob-data:
fastgpt-ob-config:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw "1234"
# 系统最高密钥凭证
x-system-key: &x-system-key "fastgpt-xxx"
# 用户登录 JWT 密钥
x-token-key: &x-token-key "fastgpt"
# 文件阅读 token 密钥
x-file-token-key: &x-file-token-key "filetokenkey"
# 密钥加密 key
x-aes256-secret-key: &x-aes256-secret-key "fastgptsecret"
# Invoke 反向调用 JWT 密钥,至少 32 位
x-invoke-token-secret: &x-invoke-token-secret "fastgpt_invoke_token_secret_32_chars_min"
# plugin auth token,v4.15 plugin 服务要求至少 32 位
x-plugin-auth-token: &x-plugin-auth-token "fastgpt-plugin-token-please-change"
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token "codesandbox"
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token "vmtoken"
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"
# aiproxy token
x-aiproxy-token: &x-aiproxy-token "token"
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt?authSource=admin
REDIS_URL: redis://default:mypassword@fastgpt-redis:6379
# @see https://doc.fastgpt.cn/self-host/config/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_CDN_ENDPOINT:
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATH:
# Log 配置
x-log-config: &x-log-config
LOG_ENABLE_CONSOLE: true
LOG_CONSOLE_LEVEL: debug
LOG_ENABLE_OTEL: false
LOG_OTEL_LEVEL: info
LOG_OTEL_URL: http://localhost:4318/v1/logs
LOG_OTEL_SERVICE_NAME: fastgpt-client
METRICS_ENABLE_OTEL: false
METRICS_OTEL_URL: http://localhost:4318/v1/metrics
METRICS_OTEL_SERVICE_NAME: fastgpt-client
TRACING_ENABLE_OTEL: false
TRACING_OTEL_URL: http://localhost:4318/v1/traces
TRACING_OTEL_SERVICE_NAME: fastgpt-client
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
no_proxy: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的服务地址配置
x-fastgpt-service-config: &x-fastgpt-service-config
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
CODE_SANDBOX_URL: http://fastgpt-code-sandbox:3000
CODE_SANDBOX_TOKEN: *x-code-sandbox-token
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
AIPROXY_API_TOKEN: *x-aiproxy-token
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的地址。启用 Agent/Skill 沙盒时,必须改成单独部署的 proxy 的 ws:// 或 wss:// 地址。
AGENT_SANDBOX_PROXY_URL:
AGENT_SANDBOX_OPENSANDBOX_BASEURL:
AGENT_SANDBOX_OPENSANDBOX_API_KEY:
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO: ghcr.io/labring/fastgpt-agent-sandbox
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG: v0.2.0
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE: ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
DEFAULT_ROOT_PSW: *x-default-root-psw
SYSTEM_NAME: FastGPT
SYSTEM_DESCRIPTION:
SYSTEM_FAVICON:
SSE_MCP_SERVER_PROXY_ENDPOINT:
MARKETPLACE_URL: https://v2.marketplace.fastgpt.cn
PASSWORD_EXPIRED_MONTH:
SHOW_COUPON: false
SHOW_DISCOUNT_COUPON: false
HIDE_CHAT_COPYRIGHT_SETTING:
CHINESE_IP_REDIRECT_URL:
PAY_FORM_URL:
AGENT_SANDBOX_FREE_TIP: false
OPENAPI_KEY_MAX_COUNT: 100
# FastGPT 与 Pro 共用环境变量(packages/service/env.ts · serviceEnv)
x-service-env-config: &x-service-env-config
HOSTNAME: 0.0.0.0
NEXT_PUBLIC_BASE_URL:
ROOT_KEY: *x-system-key
DB_MAX_LINK: 5
SYNC_INDEX: true
TOKEN_KEY: *x-token-key
FILE_TOKEN_KEY: *x-file-token-key
AES256_SECRET_KEY: *x-aes256-secret-key
INVOKE_TOKEN_SECRET: *x-invoke-token-secret
MULTIPLE_DATA_TO_BASE64: true
USE_IP_LIMIT: false
CHECK_INTERNAL_IP: false
TRUSTED_PROXY_ENABLE: false
TRUSTED_PROXY_IPS:
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
HELPER_BOT_MODEL: qwen-max
CHAT_TITLE_MODEL:
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 10
PARSE_FILE_TIMEOUT_SECONDS: 600
HTML_TO_MARKDOWN_WORKERS: 10
TEXT_TO_CHUNKS_WORKERS: 10
WORKFLOW_MAX_RUN_TIMES: 500
WORKFLOW_MAX_LOOP_TIMES: 100
WORKFLOW_PARALLEL_MAX_CONCURRENCY: 10
CHAT_MAX_QPM: 5000
SYSTEM_MAX_STRING_LENGTH_M: 100
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
MAX_FOLDER_DEPTH: 4
APP_FOLDER_MAX_AMOUNT: 1000
DATASET_FOLDER_MAX_AMOUNT: 1000
UPLOAD_FILE_MAX_SIZE: 1000
UPLOAD_FILE_MAX_AMOUNT: 1000
LLM_REQUEST_TRACKING_RETENTION_HOURS: 6
MAX_HTML_TRANSFORM_CHARS: 1000000
DATASET_PARSE_MAX_PROCESS: 10
VECTOR_MAX_PROCESS: 10
QA_MAX_PROCESS: 10
VLM_MAX_PROCESS: 10
HNSW_EF_SEARCH: 100
HNSW_MAX_SCAN_TUPLES: 100000
CUSTOM_PDF_PARSE_URL:
CUSTOM_PDF_PARSE_KEY:
DOC2X_KEY:
TEXTIN_APP_ID:
TEXTIN_SECRET_CODE:
CUSTOM_PDF_PARSE_PRICE: 0
FILE_URL_WHITELIST:
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
MILVUS_ADDRESS: zilliz_cloud_address
MILVUS_TOKEN: zilliz_cloud_token
services:
fastgpt-mongo:
image: mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: fastgpt-mongo
restart: always
networks:
- data
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- fastgpt-mongo:/data/db
healthcheck:
test:
[
"CMD",
"mongo",
"-u",
"myusername",
"-p",
"mypassword",
"--authenticationDatabase",
"admin",
"--eval",
"db.adminCommand('ping')",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "fastgpt-mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
fastgpt-redis:
image: redis:7.2-alpine
container_name: fastgpt-redis
networks:
- data
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ["CMD", "redis-cli", "-a", "mypassword", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- fastgpt-redis:/data
fastgpt-minio:
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- data
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.0
ports:
- 3000:3000
networks:
- data
- app
- codesandbox
- aiproxy
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-redis:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
fastgpt-code-sandbox:
condition: service_healthy
fastgpt-plugin:
condition: service_healthy
restart: always
environment:
# 完整变量请参考: https://github.com/labring/FastGPT/blob/main/projects/app/.env.template
<<:
[
*x-share-db-config,
*x-vec-config,
*x-log-config,
*x-no-proxy-config,
*x-fastgpt-service-config,
*x-agent-sandbox-config,
*x-service-env-config,
*x-app-env-config,
]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.0
networks:
- codesandbox
restart: always
security_opt:
- no-new-privileges:true
environment:
<<: [*x-log-config, *x-no-proxy-config]
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
SANDBOX_TOKEN: *x-code-sandbox-token
# ===== Resource Limits =====
# Maximum API JSON body size (MB), including variables
SANDBOX_API_MAX_BODY_MB: 8
# Execution timeout per request (ms)
SANDBOX_MAX_TIMEOUT: 60000
# Maximum allowed memory per user code execution (MB)
# Note: System automatically adds 50MB for runtime overhead
# Actual process limit = SANDBOX_MAX_MEMORY_MB + 50MB
SANDBOX_MAX_MEMORY_MB: 256
SANDBOX_MAX_OUTPUT_MB: 10
# Number of requests with the same queueId that may enter execution concurrently. Empty disables queueing.
SANDBOX_QUEUE_ID_CONCURRENCY:
# ===== Process Pool =====
# Number of pre-warmed worker processes (JS + Python)
SANDBOX_POOL_SIZE: 20
# ===== Network Request Limits =====
# Whether to check if the request is to a private network
CHECK_INTERNAL_IP: true
# Maximum number of HTTP requests per execution
SANDBOX_REQUEST_MAX_COUNT: 30
# Timeout for each outbound HTTP request (ms)
SANDBOX_REQUEST_TIMEOUT: 60000
# Maximum response body size for outbound requests
SANDBOX_REQUEST_MAX_RESPONSE_MB: 10
# Maximum request body size for outbound requests (MB)
SANDBOX_REQUEST_MAX_BODY_MB: 5
# ===== Module Control =====
# JS allowed modules whitelist (comma-separated)
SANDBOX_JS_ALLOWED_MODULES: lodash,dayjs,moment,uuid,crypto-js,qs,url,querystring
# Python allowed modules whitelist (comma-separated)
SANDBOX_PYTHON_ALLOWED_MODULES: math,cmath,decimal,fractions,random,statistics,collections,array,heapq,bisect,queue,copy,itertools,functools,operator,string,re,difflib,textwrap,unicodedata,codecs,datetime,time,calendar,_strptime,json,csv,base64,binascii,struct,hashlib,hmac,secrets,uuid,typing,abc,enum,dataclasses,contextlib,pprint,weakref,numpy,pandas,matplotlib
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) throw new Error(String(res.status)); })",
]
interval: 30s
timeout: 20s
retries: 3
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.23
networks:
- app
ports:
- 3003:3000
restart: always
environment:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.0
container_name: fastgpt-plugin
restart: always
networks:
- data
- app
environment:
<<: [*x-share-db-config, *x-log-config, *x-no-proxy-config]
# v4.15 plugin 服务使用独立数据库,避免和 FastGPT 主库集合冲突。
MONGODB_URI: mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin
DB_MAX_LINK: 100
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
# 传递给 OTLP 收集器的服务名称
LOG_OTEL_SERVICE_NAME: fastgpt-plugin
depends_on:
fastgpt-mongo:
condition: service_healthy
fastgpt-minio:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 20s
retries: 3
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
container_name: fastgpt-aiproxy
restart: unless-stopped
depends_on:
fastgpt-aiproxy-pg:
condition: service_healthy
networks:
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@fastgpt-aiproxy-pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
DISABLE_MODEL_CONFIG: true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
interval: 5s
timeout: 5s
retries: 10
fastgpt-aiproxy-pg:
image: pgvector/pgvector:0.8.0-pg15 # docker hub
restart: unless-stopped
container_name: fastgpt-aiproxy-pg
volumes:
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
environment:
TZ: Asia/Shanghai
POSTGRES_USER: postgres
POSTGRES_DB: aiproxy
POSTGRES_PASSWORD: aiproxy
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
interval: 5s
timeout: 5s
retries: 10
networks:
data:
name: fastgpt_data
vector:
name: fastgpt_vector
app:
name: fastgpt_app
codesandbox:
name: fastgpt_codesandbox
aiproxy:
name: fastgpt_aiproxy
volumes:
fastgpt-pg:
fastgpt-mongo:
fastgpt-redis:
fastgpt-minio:
fastgpt-milvus-minio:
fastgpt-milvus-etcd:
fastgpt-milvus-data:
fastgpt-ob-data:
fastgpt-ob-config:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
......@@ -51,50 +51,291 @@ radio_select() {
# 恢复光标
tput cnorm 2>/dev/null
echo ""
RADIO_RESULT=$selected
}
# 确保退出时恢复光标
trap 'tput cnorm 2>/dev/null; exit' INT TERM
# 生成安装期随机密钥。
# 只使用 hex 字符,避免写入 YAML、URL、命令参数时触发转义问题。
random_hex() {
local bytes="${1:-32}"
local value
if command -v openssl &>/dev/null; then
value="$(openssl rand -hex "$bytes" 2>/dev/null)"
if [ -n "$value" ]; then
printf '%s\n' "$value"
return
fi
fi
if [ -r /dev/urandom ] && command -v od &>/dev/null; then
value="$(dd if=/dev/urandom bs="$bytes" count=1 2>/dev/null | od -An -tx1 | tr -d ' \n')"
if [ -n "$value" ]; then
printf '%s\n' "$value"
return
fi
fi
echo "错误: 未找到 openssl,且无法读取 /dev/urandom 生成随机密钥" >&2
exit 1
}
escape_sed_replacement() {
printf '%s' "$1" | sed -e 's/[\/&|]/\\&/g'
}
replace_text() {
local old="$1"
local new="$2"
local file="${3:-docker-compose.yml}"
local escaped_new
escaped_new="$(escape_sed_replacement "$new")"
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s|$old|$escaped_new|g" "$file"
else
sed -i "s|$old|$escaped_new|g" "$file"
fi
}
content_error() {
local file="$1"
local source="$2"
local type="$3"
local cleanup="${4:-false}"
if [ "$cleanup" = true ]; then
rm -f "$file"
fi
echo "错误: ${type} 文件内容异常: $source" >&2
echo " 请确认该文件已经发布且内容正确,不能是 HTML 页面或空文件。" >&2
exit 1
}
validate_compose_file() {
local file="$1"
local source="$2"
local cleanup="${3:-false}"
if [ ! -s "$file" ]; then
content_error "$file" "$source" "docker-compose YAML" "$cleanup"
fi
if LC_ALL=C grep -qiE '<!doctype html|<html[[:space:]>]' "$file"; then
content_error "$file" "$source" "docker-compose YAML" "$cleanup"
fi
if ! LC_ALL=C grep -qE '^[[:space:]]*services:' "$file"; then
content_error "$file" "$source" "docker-compose YAML" "$cleanup"
fi
}
validate_config_file() {
local file="$1"
local source="$2"
local cleanup="${3:-false}"
if [ ! -s "$file" ]; then
content_error "$file" "$source" "config.json" "$cleanup"
fi
if LC_ALL=C grep -qiE '<!doctype html|<html[[:space:]>]' "$file"; then
content_error "$file" "$source" "config.json" "$cleanup"
fi
if ! LC_ALL=C grep -q '"systemEnv"' "$file"; then
content_error "$file" "$source" "config.json" "$cleanup"
fi
}
resolve_input_path() {
local input="$1"
if [ "$input" = "~" ]; then
input="$HOME"
elif [[ "$input" == ~/* ]]; then
input="$HOME/${input#~/}"
fi
if [[ "$input" != /* ]]; then
input="$(pwd)/$input"
fi
printf '%s\n' "$input"
}
prompt_local_compose_path() {
local input resolved
while true; do
read -r -p "请输入本地 docker-compose.yml 路径: " input
if [ -z "$input" ]; then
echo "路径不能为空"
continue
fi
resolved="$(resolve_input_path "$input")"
if [ -f "$resolved" ]; then
LOCAL_COMPOSE_PATH="$resolved"
break
fi
echo "未找到文件: $resolved"
done
}
ROOT_LOGIN_PASSWORD="1234"
randomize_compose_credentials() {
local system_key token_key file_token_key aes256_secret_key invoke_token_secret
local plugin_token code_sandbox_token volume_manager_token agent_proxy_secret aiproxy_token
local root_password mongo_password redis_password minio_password
local pg_password aiproxy_pg_password oceanbase_sys_password oceanbase_tenant_password seekdb_password opengauss_password
system_key="$(random_hex 32)"
token_key="$(random_hex 32)"
file_token_key="$(random_hex 32)"
aes256_secret_key="$(random_hex 32)"
invoke_token_secret="$(random_hex 32)"
plugin_token="$(random_hex 32)"
code_sandbox_token="$(random_hex 32)"
volume_manager_token="$(random_hex 32)"
agent_proxy_secret="$(random_hex 32)"
aiproxy_token="$(random_hex 32)"
root_password="$(random_hex 8)"
mongo_password="$(random_hex 16)"
redis_password="$(random_hex 16)"
minio_password="$(random_hex 16)"
pg_password="$(random_hex 16)"
aiproxy_pg_password="$(random_hex 16)"
oceanbase_sys_password="$(random_hex 16)"
oceanbase_tenant_password="$(random_hex 16)"
seekdb_password="$(random_hex 16)"
# openGauss 要求密码同时包含大小写、数字和特殊字符。放在 URL 中时 @ 需要编码。
opengauss_password="Fg$(random_hex 12)@123"
if LC_ALL=C grep -Eq "x-default-root-psw: &x-default-root-psw ['\"]1234['\"]" docker-compose.yml; then
ROOT_LOGIN_PASSWORD="$root_password"
replace_text "x-default-root-psw: &x-default-root-psw '1234'" "x-default-root-psw: &x-default-root-psw '$root_password'"
replace_text 'x-default-root-psw: &x-default-root-psw "1234"' "x-default-root-psw: &x-default-root-psw \"$root_password\""
else
ROOT_LOGIN_PASSWORD="请查看 docker-compose.yml 中 DEFAULT_ROOT_PSW"
fi
# YAML anchors: 多个服务共用的 token 只改锚点,引用方自动同步。
replace_text "x-system-key: &x-system-key 'fastgpt-xxx'" "x-system-key: &x-system-key '$system_key'"
replace_text 'x-system-key: &x-system-key "fastgpt-xxx"' "x-system-key: &x-system-key \"$system_key\""
replace_text "x-token-key: &x-token-key 'fastgpt'" "x-token-key: &x-token-key '$token_key'"
replace_text 'x-token-key: &x-token-key "fastgpt"' "x-token-key: &x-token-key \"$token_key\""
replace_text "x-file-token-key: &x-file-token-key 'filetokenkey'" "x-file-token-key: &x-file-token-key '$file_token_key'"
replace_text 'x-file-token-key: &x-file-token-key "filetokenkey"' "x-file-token-key: &x-file-token-key \"$file_token_key\""
replace_text "x-aes256-secret-key: &x-aes256-secret-key 'fastgptsecret'" "x-aes256-secret-key: &x-aes256-secret-key '$aes256_secret_key'"
replace_text 'x-aes256-secret-key: &x-aes256-secret-key "fastgptsecret"' "x-aes256-secret-key: &x-aes256-secret-key \"$aes256_secret_key\""
replace_text "x-invoke-token-secret: &x-invoke-token-secret 'fastgpt_invoke_token_secret_32_chars_min'" "x-invoke-token-secret: &x-invoke-token-secret '$invoke_token_secret'"
replace_text 'x-invoke-token-secret: &x-invoke-token-secret "fastgpt_invoke_token_secret_32_chars_min"' "x-invoke-token-secret: &x-invoke-token-secret \"$invoke_token_secret\""
replace_text "x-plugin-auth-token: &x-plugin-auth-token 'token'" "x-plugin-auth-token: &x-plugin-auth-token '$plugin_token'"
replace_text 'x-plugin-auth-token: &x-plugin-auth-token "token"' "x-plugin-auth-token: &x-plugin-auth-token \"$plugin_token\""
replace_text "x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-token-please-change'" "x-plugin-auth-token: &x-plugin-auth-token '$plugin_token'"
replace_text 'x-plugin-auth-token: &x-plugin-auth-token "fastgpt-plugin-token-please-change"' "x-plugin-auth-token: &x-plugin-auth-token \"$plugin_token\""
replace_text "x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'" "x-code-sandbox-token: &x-code-sandbox-token '$code_sandbox_token'"
replace_text 'x-code-sandbox-token: &x-code-sandbox-token "codesandbox"' "x-code-sandbox-token: &x-code-sandbox-token \"$code_sandbox_token\""
replace_text "x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'" "x-volume-manager-auth-token: &x-volume-manager-auth-token '$volume_manager_token'"
replace_text 'x-volume-manager-auth-token: &x-volume-manager-auth-token "vmtoken"' "x-volume-manager-auth-token: &x-volume-manager-auth-token \"$volume_manager_token\""
replace_text "x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'" "x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret '$agent_proxy_secret'"
replace_text 'x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"' "x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret \"$agent_proxy_secret\""
replace_text "x-aiproxy-token: &x-aiproxy-token 'token'" "x-aiproxy-token: &x-aiproxy-token '$aiproxy_token'"
replace_text 'x-aiproxy-token: &x-aiproxy-token "token"' "x-aiproxy-token: &x-aiproxy-token \"$aiproxy_token\""
# 旧版本没有为这些密钥设置 anchor,需要直接替换环境变量默认值。
replace_text "TOKEN_KEY: fastgpt" "TOKEN_KEY: $token_key"
replace_text "FILE_TOKEN_KEY: filetokenkey" "FILE_TOKEN_KEY: $file_token_key"
replace_text "AES256_SECRET_KEY: fastgptsecret" "AES256_SECRET_KEY: $aes256_secret_key"
replace_text "INVOKE_TOKEN_SECRET: fastgpt_invoke_token_secret_32_chars_min" "INVOKE_TOKEN_SECRET: $invoke_token_secret"
# MongoDB 主库与 plugin 独立库使用同一个 Mongo root 密码。
replace_text "mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt?authSource=admin" "mongodb://myusername:$mongo_password@fastgpt-mongo:27017/fastgpt?authSource=admin"
replace_text "mongodb://myusername:mypassword@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin" "mongodb://myusername:$mongo_password@fastgpt-mongo:27017/fastgpt-plugin?authSource=admin"
replace_text "- MONGO_INITDB_ROOT_PASSWORD=mypassword" "- MONGO_INITDB_ROOT_PASSWORD=$mongo_password"
replace_text "'-p', 'mypassword'" "'-p', '$mongo_password'"
replace_text '"mypassword",' "\"$mongo_password\","
replace_text " mongo -u myusername -p mypassword " " mongo -u myusername -p $mongo_password "
# Redis 密码需要同时改连接串、启动命令和健康检查。
replace_text "redis://default:mypassword@fastgpt-redis:6379" "redis://default:$redis_password@fastgpt-redis:6379"
replace_text "redis-server --requirepass mypassword " "redis-server --requirepass $redis_password "
replace_text "'redis-cli', '-a', 'mypassword', 'ping'" "'redis-cli', '-a', '$redis_password', 'ping'"
replace_text '"redis-cli", "-a", "mypassword", "ping"' "\"redis-cli\", \"-a\", \"$redis_password\", \"ping\""
# FastGPT 自带 MinIO。用户名保持 minioadmin 便于识别和登录控制台,只随机化密钥。
replace_text "STORAGE_SECRET_ACCESS_KEY: minioadmin" "STORAGE_SECRET_ACCESS_KEY: $minio_password"
replace_text "MINIO_SECRET_KEY: minioadmin" "MINIO_SECRET_KEY: $minio_password"
replace_text "- MINIO_ROOT_PASSWORD=minioadmin" "- MINIO_ROOT_PASSWORD=$minio_password"
# 本地 PG 向量库,仅在选择 pg 时存在。
replace_text "PG_URL: postgresql://username:password@fastgpt-vector:5432/postgres" "PG_URL: postgresql://username:$pg_password@fastgpt-vector:5432/postgres"
replace_text "- POSTGRES_PASSWORD=password" "- POSTGRES_PASSWORD=$pg_password"
# AIProxy 自带 PG。
replace_text "SQL_DSN: postgres://postgres:aiproxy@fastgpt-aiproxy-pg:5432/aiproxy" "SQL_DSN: postgres://postgres:$aiproxy_pg_password@fastgpt-aiproxy-pg:5432/aiproxy"
replace_text "POSTGRES_PASSWORD: aiproxy" "POSTGRES_PASSWORD: $aiproxy_pg_password"
# OceanBase / SeekDB 向量库,仅在对应选择下存在。
replace_text "OCEANBASE_URL: mysql://root%40tenantname:tenantpassword@fastgpt-vector:2881/mysql" "OCEANBASE_URL: mysql://root%40tenantname:$oceanbase_tenant_password@fastgpt-vector:2881/mysql"
replace_text "- OB_SYS_PASSWORD=obsyspassword" "- OB_SYS_PASSWORD=$oceanbase_sys_password"
replace_text "- OB_TENANT_PASSWORD=tenantpassword" "- OB_TENANT_PASSWORD=$oceanbase_tenant_password"
replace_text "-ptenantpassword" "-p$oceanbase_tenant_password"
replace_text "SEEKDB_URL: mysql://root:seekdbpassword@fastgpt-vector:2881/mysql" "SEEKDB_URL: mysql://root:$seekdb_password@fastgpt-vector:2881/mysql"
replace_text "- ROOT_PASSWORD=seekdbpassword" "- ROOT_PASSWORD=$seekdb_password"
replace_text "'-pseekdbpassword'" "'-p$seekdb_password'"
# openGauss 向量库,仅在对应选择下存在。连接串中的 @ 必须编码为 %40。
replace_text "OPENGAUSS_URL: postgresql://gaussdb:FastGPT@123@fastgpt-vector:5432/fastgpt" "OPENGAUSS_URL: postgresql://gaussdb:${opengauss_password/@/%40}@fastgpt-vector:5432/fastgpt"
replace_text "- GS_PASSWORD=FastGPT@123" "- GS_PASSWORD=$opengauss_password"
}
# ========== 部署版本列表(由 deploy/init.mjs 自动生成) ==========
# BEGIN GENERATED DEPLOY VERSIONS
DEPLOY_VERSIONS=(
"v4.15"
"v4.14"
"main"
)
# END GENERATED DEPLOY VERSIONS
LOCAL_DEPLOY_VERSION="local"
LOCAL_DEPLOY_LABEL="本地 docker-compose.yml"
# 获取部署版本展示文案:main 为迭代版,其他版本均视为稳定版
get_version_label() {
local version="$1"
if [ "$version" == "main" ]; then
if [ "$version" == "$LOCAL_DEPLOY_VERSION" ]; then
echo "$LOCAL_DEPLOY_LABEL"
elif [ "$version" == "main" ]; then
echo "迭代版 main"
else
echo "稳定版 $version"
fi
}
# ========== 1. 选择镜像源 ==========
radio_select "请选择镜像源 (↑↓ 选择, 回车确认):" "阿里云 (中国大陆)" "GitHub (全球)"
case $RADIO_RESULT in
1)
REGION="global"
BASE_URL="https://doc.fastgpt.io/deploy"
;;
*)
REGION="cn"
BASE_URL="https://doc.fastgpt.cn/deploy"
;;
esac
# ========== 2. 选择部署版本 ==========
# ========== 1. 选择部署版本 ==========
if [ ${#DEPLOY_VERSIONS[@]} -eq 0 ]; then
echo "错误: 未配置部署版本"
exit 1
fi
if [ -n "$FASTGPT_DEPLOY_VERSION" ]; then
LOCAL_COMPOSE_PATH=""
if [ -n "$FASTGPT_LOCAL_COMPOSE_PATH" ]; then
DEPLOY_VERSION="$LOCAL_DEPLOY_VERSION"
LOCAL_COMPOSE_PATH="$(resolve_input_path "$FASTGPT_LOCAL_COMPOSE_PATH")"
if [ ! -f "$LOCAL_COMPOSE_PATH" ]; then
echo "错误: FASTGPT_LOCAL_COMPOSE_PATH 指向的文件不存在: $LOCAL_COMPOSE_PATH"
exit 1
fi
elif [ -n "$FASTGPT_DEPLOY_VERSION" ]; then
version_matched=false
for version in "${DEPLOY_VERSIONS[@]}"; do
if [ "$FASTGPT_DEPLOY_VERSION" == "$version" ]; then
......@@ -107,7 +348,7 @@ if [ -n "$FASTGPT_DEPLOY_VERSION" ]; then
DEPLOY_VERSION="$FASTGPT_DEPLOY_VERSION"
else
echo "错误: 不支持的 FASTGPT_DEPLOY_VERSION: $FASTGPT_DEPLOY_VERSION"
echo "可选版本: ${DEPLOY_VERSIONS[*]}"
echo "可选版本: ${DEPLOY_VERSIONS[*]} $LOCAL_DEPLOY_VERSION"
exit 1
fi
else
......@@ -115,22 +356,54 @@ else
for version in "${DEPLOY_VERSIONS[@]}"; do
VERSION_OPTIONS+=("$(get_version_label "$version")")
done
VERSION_OPTIONS+=("$LOCAL_DEPLOY_LABEL")
radio_select "请选择部署版本 (↑↓ 选择, 回车确认):" "${VERSION_OPTIONS[@]}"
if [ $RADIO_RESULT -eq ${#DEPLOY_VERSIONS[@]} ]; then
DEPLOY_VERSION="$LOCAL_DEPLOY_VERSION"
prompt_local_compose_path
else
DEPLOY_VERSION="${DEPLOY_VERSIONS[$RADIO_RESULT]}"
fi
fi
# ========== 2. 选择镜像源 ==========
if [ "$DEPLOY_VERSION" != "$LOCAL_DEPLOY_VERSION" ]; then
radio_select "请选择镜像源 (↑↓ 选择, 回车确认):" "阿里云 (中国大陆)" "GitHub (全球)"
case $RADIO_RESULT in
1)
REGION="global"
BASE_URL="https://doc.fastgpt.io/deploy"
;;
*)
REGION="cn"
BASE_URL="https://doc.fastgpt.cn/deploy"
;;
esac
fi
# ========== 3. 选择向量数据库 ==========
radio_select "请选择向量数据库 (↑↓ 选择, 回车确认):" "PostgreSQL + pgvector" "Milvus" "Zilliz" "OceanBase" "SeekDB"
case $RADIO_RESULT in
if [ "$DEPLOY_VERSION" == "$LOCAL_DEPLOY_VERSION" ]; then
VECTOR="local"
else
radio_select "请选择向量数据库 (↑↓ 选择, 回车确认):" "PostgreSQL + pgvector" "Milvus" "Zilliz" "OceanBase" "SeekDB"
case $RADIO_RESULT in
1) VECTOR="milvus" ;;
2) VECTOR="zilliz" ;;
3) VECTOR="oceanbase" ;;
4) VECTOR="seekdb" ;;
*) VECTOR="pg" ;;
esac
fi
# ========== 4. 选择是否自动生成密钥 ==========
radio_select "是否自动生成登录密码、服务 Token、应用密钥和组件密码? (↑↓ 选择, 回车确认):" "自动生成 (推荐)" "不自动生成"
case $RADIO_RESULT in
1) AUTO_GENERATE_CREDENTIALS=false ;;
*) AUTO_GENERATE_CREDENTIALS=true ;;
esac
# ========== 4. 检测可用 IP ==========
# ========== 5. 检测可用 IP ==========
IP_LIST=()
PRIMARY_IP=""
......@@ -208,12 +481,12 @@ select_address() {
fi
}
# ========== 5. 选择 S3 访问地址 (端口 9000) ==========
# ========== 6. 选择 S3 访问地址 (端口 9000) ==========
select_address "请选择 S3 访问地址 - 客户端和容器均需可访问 (↑↓ 选择, 回车确认, 通常默认第一个即可):" 9000
S3_ADDR="$SELECTED_ADDR"
S3_CUSTOM=$SELECTED_CUSTOM
# ========== 6. 选择 SSE MCP 访问地址 (端口 3003) ==========
# ========== 7. 选择 SSE MCP 访问地址 (端口 3003) ==========
select_address "请选择 SSE MCP 访问地址 - 客户端和容器均需可访问 (↑↓ 选择, 回车确认, 通常默认第一个即可):" 3003
MCP_ADDR="$SELECTED_ADDR"
MCP_CUSTOM=$SELECTED_CUSTOM
......@@ -247,13 +520,23 @@ else
MCP_DISPLAY="未设置"
fi
CREDENTIALS_LABEL="自动生成"
if [ "$AUTO_GENERATE_CREDENTIALS" = false ]; then
CREDENTIALS_LABEL="不自动生成"
fi
echo ""
echo "=============================="
echo " 部署版本: $DEPLOY_VERSION_LABEL"
echo " 镜像源: $REGION_LABEL"
echo " 向量数据库: $VECTOR"
if [ "$DEPLOY_VERSION" == "$LOCAL_DEPLOY_VERSION" ]; then
echo " Compose 文件: $LOCAL_COMPOSE_PATH"
else
echo " 镜像源: $REGION_LABEL"
echo " 向量数据库: $VECTOR"
fi
echo " S3 地址: $S3_DISPLAY"
echo " MCP 地址: $MCP_DISPLAY"
echo " 密钥处理: $CREDENTIALS_LABEL"
echo "=============================="
echo ""
read -p "确认以上配置? (y/n) [y]: " confirm
......@@ -262,39 +545,101 @@ if [ "$confirm" == "n" ]; then
exit 1
fi
# ========== 下载文件 ==========
# ========== 获取配置文件 ==========
echo ""
echo "正在下载配置文件..."
if [ "$DEPLOY_VERSION" == "$LOCAL_DEPLOY_VERSION" ]; then
echo "正在复制本地配置文件..."
else
echo "正在下载配置文件..."
fi
# 构建下载链接(处理 global 下 zilliz 文件名差异)
VECTOR_FILE="$VECTOR"
if [ "$REGION" == "global" ] && [ "$VECTOR" == "zilliz" ]; then
if [ "$DEPLOY_VERSION" == "$LOCAL_DEPLOY_VERSION" ]; then
LOCAL_COMPOSE_TMP="docker-compose.yml.tmp"
cp "$LOCAL_COMPOSE_PATH" "$LOCAL_COMPOSE_TMP"
if [ $? -ne 0 ]; then
echo "错误: 复制本地 docker-compose.yml 失败: $LOCAL_COMPOSE_PATH"
rm -f "$LOCAL_COMPOSE_TMP"
exit 1
fi
validate_compose_file "$LOCAL_COMPOSE_TMP" "$LOCAL_COMPOSE_PATH" true
mv "$LOCAL_COMPOSE_TMP" docker-compose.yml
echo "已复制 docker-compose.yml"
else
# 构建下载链接(处理 global 下 zilliz 文件名差异)
VECTOR_FILE="$VECTOR"
if [ "$REGION" == "global" ] && [ "$VECTOR" == "zilliz" ]; then
VECTOR_FILE="zilliz"
fi
fi
YML_URL="${BASE_URL}/docker/${DEPLOY_VERSION}/${REGION}/docker-compose.${VECTOR_FILE}.yml"
CONFIG_URL="${BASE_URL}/config/config.json"
YML_URL="${BASE_URL}/docker/${DEPLOY_VERSION}/${REGION}/docker-compose.${VECTOR_FILE}.yml"
# 下载 docker-compose YAML
curl -fsSL -O "$YML_URL"
if [ $? -ne 0 ]; then
# 下载 docker-compose YAML
YML_FILE="docker-compose.${VECTOR_FILE}.yml"
curl -fsSL "$YML_URL" -o "$YML_FILE"
if [ $? -ne 0 ]; then
echo "错误: 下载 YAML 文件失败: $YML_URL"
rm -f "$YML_FILE"
exit 1
fi
validate_compose_file "$YML_FILE" "$YML_URL" true
mv "$YML_FILE" docker-compose.yml
echo "已下载 docker-compose.yml"
fi
mv "docker-compose.${VECTOR_FILE}.yml" docker-compose.yml
echo "已下载 docker-compose.yml"
USES_CONFIG_JSON=false
if LC_ALL=C grep -q -- "./config.json:/app/data/config.json" docker-compose.yml; then
USES_CONFIG_JSON=true
# 下载旧版本 docker-compose 仍挂载的 config.json。
curl -fsSL -O "$CONFIG_URL"
CONFIG_FILE="config.json.tmp"
if [ "$DEPLOY_VERSION" == "$LOCAL_DEPLOY_VERSION" ]; then
LOCAL_CONFIG_PATH="$(dirname "$LOCAL_COMPOSE_PATH")/config.json"
if [ -f "$LOCAL_CONFIG_PATH" ]; then
cp "$LOCAL_CONFIG_PATH" "$CONFIG_FILE"
if [ $? -ne 0 ]; then
echo "错误: 复制本地 config.json 失败: $LOCAL_CONFIG_PATH"
rm -f "$CONFIG_FILE"
exit 1
fi
validate_config_file "$CONFIG_FILE" "$LOCAL_CONFIG_PATH" true
mv "$CONFIG_FILE" config.json
echo "已复制 config.json"
else
CONFIG_URL="https://doc.fastgpt.cn/deploy/config/config.json"
curl -fsSL "$CONFIG_URL" -o "$CONFIG_FILE"
if [ $? -ne 0 ]; then
echo "错误: 下载 config.json 失败: $CONFIG_URL"
rm -f "$CONFIG_FILE"
exit 1
fi
validate_config_file "$CONFIG_FILE" "$CONFIG_URL" true
mv "$CONFIG_FILE" config.json
echo "已下载 config.json"
fi
else
CONFIG_URL="${BASE_URL}/config/config.json"
curl -fsSL "$CONFIG_URL" -o "$CONFIG_FILE"
if [ $? -ne 0 ]; then
echo "错误: 下载 config.json 失败: $CONFIG_URL"
rm -f "$CONFIG_FILE"
exit 1
fi
validate_config_file "$CONFIG_FILE" "$CONFIG_URL" true
mv "$CONFIG_FILE" config.json
echo "已下载 config.json"
fi
fi
# ========== 随机化默认密钥 ==========
if [ "$AUTO_GENERATE_CREDENTIALS" = true ]; then
randomize_compose_credentials
echo "已随机生成 docker-compose.yml 中的登录密码、服务 Token、应用密钥和组件密码"
else
if LC_ALL=C grep -Eq "x-default-root-psw: &x-default-root-psw ['\"]1234['\"]" docker-compose.yml; then
ROOT_LOGIN_PASSWORD="1234"
else
ROOT_LOGIN_PASSWORD="请查看 docker-compose.yml 中 DEFAULT_ROOT_PSW"
fi
echo "已跳过自动生成密钥,请确认 docker-compose.yml 中的默认凭证已手动修改"
fi
# ========== 替换 S3 访问地址 ==========
......@@ -390,7 +735,7 @@ else
fi
fi
if [ "$DEPLOY_VERSION" != "main" ]; then
if LC_ALL=C grep -q -- "- /var/run/docker.sock:/var/run/docker.sock" docker-compose.yml; then
# ========== 检测并替换 docker.sock 路径 ==========
# 某些发行版 / Docker Desktop / rootless 模式下,宿主机 docker.sock 不在 /var/run/docker.sock
# 若路径错误,Docker 会把挂载目标在容器内创建为空目录,导致 volume-manager / opensandbox 无法调用 Docker API
......@@ -436,7 +781,7 @@ if [ "$DEPLOY_VERSION" != "main" ]; then
else
sed -i "s|- /var/run/docker.sock:/var/run/docker.sock|- ${ESCAPED_SOCK}:/var/run/docker.sock|g" docker-compose.yml
fi
echo "已检测到 Docker socket: $HOST_SOCK,已更新 docker-compose.yml 挂载路径"
printf '已检测到 Docker socket: %s,已更新 docker-compose.yml 挂载路径\n' "$HOST_SOCK"
else
echo "Docker socket 路径正常: /var/run/docker.sock"
fi
......@@ -450,18 +795,25 @@ fi
# ========== 完成 ==========
echo ""
echo "配置下载成功! 后续操作:"
if [ "$DEPLOY_VERSION" != "main" ]; then
if [ "$AUTO_GENERATE_CREDENTIALS" = true ]; then
echo " 注意: docker-compose.yml 已随机生成登录密码、服务 Token、应用密钥和组件密码。"
echo " 请妥善保存该文件,后续升级时不要直接丢失这些凭证。"
else
echo " 注意: docker-compose.yml 未自动生成登录密码、服务 Token、应用密钥和组件密码。"
echo " 生产环境启动前请手动修改默认凭证。"
fi
if LC_ALL=C grep -q "opensandbox-agent-sandbox-image" docker-compose.yml; then
echo " 1. 预热沙盒: docker compose --profile prepull pull opensandbox-agent-sandbox-image opensandbox-execd-image opensandbox-egress-image"
echo " 2. 启动服务: docker compose up -d"
echo " 3. 开放端口: 3000, 9000, 3003"
echo " 4. 访问服务: http://localhost:3000"
echo " 5. 登录服务: 默认账号为 'root', 密码为: '1234'"
echo " 5. 登录服务: 默认账号为 'root', 密码为: '$ROOT_LOGIN_PASSWORD'"
echo " 6. 配置模型: 在 '账号-模型提供商' 页面,进行模型配置"
else
echo " 1. 启动服务: docker compose up -d"
echo " 2. 开放端口: 3000, 9000, 3003"
echo " 3. 访问服务: http://localhost:3000"
echo " 4. 登录服务: 默认账号为 'root', 密码为: '1234'"
echo " 4. 登录服务: 默认账号为 'root', 密码为: '$ROOT_LOGIN_PASSWORD'"
echo " 5. 配置模型: 在 '账号-模型提供商' 页面,进行模型配置"
fi
echo ""
......
......@@ -78,6 +78,10 @@ function stripFragment(url) {
return url.split('#')[0].split('?')[0];
}
function isSkippedAttachment(target) {
return /^\/deploy\/.+\.ya?ml$/i.test(target);
}
function normalizeRoutePath(p) {
return p.replace(/\/+$/, '').replace(/\.(en\.)?(mdx|md)$/i, '');
}
......@@ -116,6 +120,7 @@ function isValidRef(url, mdxPath) {
// 绝对路径
if (target.startsWith('/')) {
if (isSkippedAttachment(target)) return { ok: true };
if (target.startsWith('/imgs/')) {
const p = path.join(PUBLIC_DIR, target);
return fileExists(p) ? { ok: true } : { ok: false, expected: p };
......
{
"associated_skills": "关联 Skill",
"associated_skills": "关联技能",
"confirm_delete_action": "坚持删除",
"confirm_delete_title": "确定删除该技能吗?",
"confirm_delete_with_refs": "该技能当前正被<bold>{{count}}个应用</bold>引用。删除后,相关应用将<bold>无法调用此技能</bold>。建议先解除关联或备份配置。",
......@@ -15,10 +15,10 @@
"deploy_success": "发布成功",
"edit_failed": "编辑失败",
"edit_success": "编辑成功",
"empty_state_community_prefix": "通过对话预览 Skill 效果,",
"empty_state_community_suffix": "可使用 AI 生成 Skill。",
"empty_state_community_prefix": "通过对话预览技能效果,",
"empty_state_community_suffix": "可使用 AI 生成技能。",
"empty_state_community_upgrade": "升级商业版",
"empty_state_tip": "告诉 AI 如何修改 Skill,\n或让 AI 运行 Skill 查看效果",
"empty_state_tip": "告诉 AI 如何修改技能,\n或让 AI 运行技能查看效果",
"export_config": "导出配置",
"export_failed": "导出失败",
"export_success": "导出成功",
......@@ -30,28 +30,28 @@
"move_failed": "移动失败",
"move_skill": "移动技能",
"move_skill_hint": "移动后,所选技能/文件夹将继承新文件夹的权限设置。",
"no_current_version": "Skill 暂无可用版本,请重新创建或导入后再编辑。",
"no_skills": "暂无 Skill",
"permission.des.manage": "可管理 Agent Skill 和协作者",
"permission.des.read": "可查看 Agent Skill",
"permission.des.write": "可编辑 Agent Skill",
"no_current_version": "技能暂无可用版本,请重新创建或导入后再编辑。",
"no_skills": "暂无技能",
"permission.des.manage": "可管理 Agent 技能和协作者",
"permission.des.read": "可查看 Agent 技能",
"permission.des.write": "可编辑 Agent 技能",
"permission_settings": "权限设置",
"related_apps_hidden": "其余 {{count}} 个应用无权限查看",
"related_count": "关联应用",
"sandbox_auto_enabled_for_skill": "skill运行依赖虚拟机环境,已为你打开虚拟机功能",
"sandbox_auto_enabled_for_skill": "技能运行依赖虚拟机环境,已为你打开虚拟机功能",
"sandbox_checking": "正在检查现有沙箱环境...",
"sandbox_connecting": "正在连接沙箱环境...",
"sandbox_creating_container": "正在初始化云端沙箱...",
"sandbox_deploying_skills": "正在部署 Skill: {{skillName}}...",
"sandbox_disable_blocked_toast": "Skill运行依赖虚拟机环境,当前 Agent 已配置 Skill,请先移除所有 Skill 再关闭虚拟机",
"sandbox_downloading": "正在下载 Skill 包...",
"sandbox_deploying_skills": "正在部署技能: {{skillName}}...",
"sandbox_disable_blocked_toast": "技能运行依赖虚拟机环境,当前 Agent 已配置技能,请先移除所有技能再关闭虚拟机",
"sandbox_downloading": "正在下载技能包...",
"sandbox_error_title": "沙箱创建失败",
"sandbox_extracting": "正在解压 Skill 包...",
"sandbox_extracting": "正在解压技能包...",
"sandbox_failed": "沙箱创建失败: {{message}}",
"sandbox_fetch_skills": "正在获取 Skill 配置信息...",
"sandbox_fetch_skills": "正在获取技能配置信息...",
"sandbox_lazy_init": "正在初始化运行环境...",
"sandbox_operation_plan_not_supported_content": "skill操作依赖虚拟机环境。当前套餐不支持虚拟机功能,请升级套餐后继续使用。",
"sandbox_operation_system_not_configured_content": "skill操作依赖虚拟机环境。当前系统未配置虚拟机,暂时无法使用相关功能,请联系管理员配置。",
"sandbox_operation_plan_not_supported_content": "技能操作依赖虚拟机环境。当前套餐不支持虚拟机功能,请升级套餐后继续使用。",
"sandbox_operation_system_not_configured_content": "技能操作依赖虚拟机环境。当前系统未配置虚拟机,暂时无法使用相关功能,请联系管理员配置。",
"sandbox_operation_system_not_configured_title": "未配置虚拟机",
"sandbox_plan_not_supported_title": "套餐不支持功能",
"sandbox_ready": "沙箱环境就绪",
......@@ -64,23 +64,23 @@
"sandbox_runtime_upgrade_failed": "升级失败,请重新尝试",
"sandbox_runtime_upgrade_in_progress": "沙盒正在升级中",
"sandbox_runtime_upgrade_required": "虚拟机环境升级提示",
"sandbox_skill_plan_not_supported_content": "skill运行依赖虚拟机环境。当前套餐不支持虚拟机功能,请升级套餐后继续使用。",
"sandbox_skill_system_not_configured_toast": "skill运行依赖虚拟机环境。当前系统未配置虚拟机,暂时无法使用相关功能,请联系管理员配置。",
"sandbox_skill_unavailable_toast": "Skill运行依赖虚拟机环境,当前 Agent 已配置 Skill,请先移除所有 Skill 再关闭虚拟机",
"sandbox_skill_plan_not_supported_content": "技能运行依赖虚拟机环境。当前套餐不支持虚拟机功能,请升级套餐后继续使用。",
"sandbox_skill_system_not_configured_toast": "技能运行依赖虚拟机环境。当前系统未配置虚拟机,暂时无法使用相关功能,请联系管理员配置。",
"sandbox_skill_unavailable_toast": "技能运行依赖虚拟机环境,当前 Agent 已配置技能,请先移除所有技能再关闭虚拟机",
"sandbox_system_not_configured_toast": "当前系统未配置虚拟机,暂时无法使用相关功能,请联系管理员配置。",
"sandbox_unavailable_tag": "不可用",
"sandbox_upgrade_action": "去升级",
"sandbox_uploading": "正在上传 Skill 包到沙箱...",
"sandbox_uploading": "正在上传技能包到沙箱...",
"search_skill": "搜索",
"select_skill": "选择 Skill",
"select_skill": "选择技能",
"skill_avatar_and_name": "头像 & 名称",
"skill_deleted": "技能已删除",
"skill_deleted_click_remove_tip": "技能已删除,点击删除",
"skill_info_edit": "技能信息编辑",
"skill_intro_label": "应用介绍",
"skill_intro_placeholder": "介绍使用场景及途径",
"skill_name_placeholder": "请输入 Skill 名称",
"skill_select_limit_tip": "已达到单个应用可关联 Skill 的上限(100 个)",
"skill_name_placeholder": "请输入技能名称",
"skill_select_limit_tip": "已达到单个应用可关联技能的上限(100 个)",
"unnamed_skill": "未命名",
"unsupported_file_format": "不支持 {{ext}} 文件格式"
}
{
"associated_skills": "關聯 Skill",
"associated_skills": "關聯技能",
"confirm_delete_action": "堅持刪除",
"confirm_delete_title": "確定刪除該技能嗎?",
"confirm_delete_with_refs": "該技能當前正被<bold>{{count}}個應用</bold>引用。刪除後,相關應用將<bold>無法調用此技能</bold>。建議先解除關聯或備份配置。",
......@@ -15,10 +15,10 @@
"deploy_success": "發布成功",
"edit_failed": "編輯失敗",
"edit_success": "編輯成功",
"empty_state_community_prefix": "透過對話預覽 Skill 效果,",
"empty_state_community_suffix": "可使用 AI 生成 Skill。",
"empty_state_community_prefix": "透過對話預覽技能效果,",
"empty_state_community_suffix": "可使用 AI 生成技能。",
"empty_state_community_upgrade": "升級商業版",
"empty_state_tip": "告訴 AI 如何修改 Skill,\n或讓 AI 運行 Skill 查看效果",
"empty_state_tip": "告訴 AI 如何修改技能,\n或讓 AI 運行技能查看效果",
"export_config": "導出配置",
"export_failed": "導出失敗",
"export_success": "導出成功",
......@@ -28,30 +28,30 @@
"import_skill_max_size_tip": "單次最多上傳 {{maxCount}} 個文件,單個文件最大 {{maxSize}}",
"import_skill_select_file": "上傳技能",
"move_failed": "移動失敗",
"move_skill": "移動 Skill",
"move_skill_hint": "移動後,所選 Skill/文件夾將繼承新文件夾的權限設置。",
"no_current_version": "Skill 暫無可用版本,請重新建立或匯入後再編輯。",
"no_skills": "暫無 Skill",
"permission.des.manage": "可管理 Agent Skill 和協作者",
"permission.des.read": "可查看 Agent Skill",
"permission.des.write": "可編輯 Agent Skill",
"move_skill": "移動技能",
"move_skill_hint": "移動後,所選技能/文件夾將繼承新文件夾的權限設置。",
"no_current_version": "技能暫無可用版本,請重新建立或匯入後再編輯。",
"no_skills": "暫無技能",
"permission.des.manage": "可管理 Agent 技能和協作者",
"permission.des.read": "可查看 Agent 技能",
"permission.des.write": "可編輯 Agent 技能",
"permission_settings": "權限設置",
"related_apps_hidden": "其餘 {{count}} 個應用無權限查看",
"related_count": "關聯應用",
"sandbox_auto_enabled_for_skill": "skill運行依賴虛擬機器環境,已為你開啟虛擬機器功能",
"sandbox_auto_enabled_for_skill": "技能運行依賴虛擬機器環境,已為你開啟虛擬機器功能",
"sandbox_checking": "正在檢查現有沙箱環境...",
"sandbox_connecting": "正在連接沙箱環境...",
"sandbox_creating_container": "正在初始化雲端沙箱...",
"sandbox_deploying_skills": "正在部署 Skill: {{skillName}}...",
"sandbox_disable_blocked_toast": "Skill運行依賴虛擬機器環境,目前 Agent 已配置 Skill,請先移除所有 Skill 再關閉虛擬機器",
"sandbox_downloading": "正在下載 Skill 包...",
"sandbox_deploying_skills": "正在部署技能: {{skillName}}...",
"sandbox_disable_blocked_toast": "技能運行依賴虛擬機器環境,目前 Agent 已配置技能,請先移除所有技能再關閉虛擬機器",
"sandbox_downloading": "正在下載技能包...",
"sandbox_error_title": "沙箱創建失敗",
"sandbox_extracting": "正在解壓 Skill 包...",
"sandbox_extracting": "正在解壓技能包...",
"sandbox_failed": "沙箱創建失敗: {{message}}",
"sandbox_fetch_skills": "正在獲取 Skill 配置資訊...",
"sandbox_fetch_skills": "正在獲取技能配置資訊...",
"sandbox_lazy_init": "正在初始化運行環境...",
"sandbox_operation_plan_not_supported_content": "skill操作依賴虛擬機器環境。目前套餐不支援虛擬機器功能,請升級套餐後繼續使用。",
"sandbox_operation_system_not_configured_content": "skill操作依賴虛擬機器環境。目前系統未配置虛擬機器,暫時無法使用相關功能,請聯絡管理員配置。",
"sandbox_operation_plan_not_supported_content": "技能操作依賴虛擬機器環境。目前套餐不支援虛擬機器功能,請升級套餐後繼續使用。",
"sandbox_operation_system_not_configured_content": "技能操作依賴虛擬機器環境。目前系統未配置虛擬機器,暫時無法使用相關功能,請聯絡管理員配置。",
"sandbox_operation_system_not_configured_title": "未配置虛擬機器",
"sandbox_plan_not_supported_title": "套餐不支援功能",
"sandbox_ready": "沙箱環境就緒",
......@@ -64,23 +64,23 @@
"sandbox_runtime_upgrade_failed": "升級失敗,請重新嘗試",
"sandbox_runtime_upgrade_in_progress": "沙盒正在升級中",
"sandbox_runtime_upgrade_required": "虛擬機環境升級提示",
"sandbox_skill_plan_not_supported_content": "skill運行依賴虛擬機器環境。目前套餐不支援虛擬機器功能,請升級套餐後繼續使用。",
"sandbox_skill_system_not_configured_toast": "skill運行依賴虛擬機器環境。目前系統未配置虛擬機器,暫時無法使用相關功能,請聯絡管理員配置。",
"sandbox_skill_unavailable_toast": "Skill運行依賴虛擬機器環境,目前 Agent 已配置 Skill,請先移除所有 Skill 再關閉虛擬機器",
"sandbox_skill_plan_not_supported_content": "技能運行依賴虛擬機器環境。目前套餐不支援虛擬機器功能,請升級套餐後繼續使用。",
"sandbox_skill_system_not_configured_toast": "技能運行依賴虛擬機器環境。目前系統未配置虛擬機器,暫時無法使用相關功能,請聯絡管理員配置。",
"sandbox_skill_unavailable_toast": "技能運行依賴虛擬機器環境,目前 Agent 已配置技能,請先移除所有技能再關閉虛擬機器",
"sandbox_system_not_configured_toast": "目前系統未配置虛擬機器,暫時無法使用相關功能,請聯絡管理員配置。",
"sandbox_unavailable_tag": "不可用",
"sandbox_upgrade_action": "去升級",
"sandbox_uploading": "正在上傳 Skill 包到沙箱...",
"sandbox_uploading": "正在上傳技能包到沙箱...",
"search_skill": "搜尋",
"select_skill": "選擇 Skill",
"select_skill": "選擇技能",
"skill_avatar_and_name": "頭像 & 名稱",
"skill_deleted": "技能已刪除",
"skill_deleted_click_remove_tip": "技能已刪除,點擊刪除",
"skill_info_edit": "技能資訊編輯",
"skill_intro_label": "應用介紹",
"skill_intro_placeholder": "介紹使用場景及途徑",
"skill_name_placeholder": "請輸入 Skill 名稱",
"skill_select_limit_tip": "已達到單個應用可關聯 Skill 的上限(100 個)",
"skill_name_placeholder": "請輸入技能名稱",
"skill_select_limit_tip": "已達到單個應用可關聯技能的上限(100 個)",
"unnamed_skill": "未命名",
"unsupported_file_format": "不支持 {{ext}} 文件格式"
}
import { beforeEach, describe, expect, it } from 'vitest';
import { afterAll, beforeEach, describe, expect, it } from 'vitest';
import {
ChatRoleEnum,
ChatSourceEnum,
......@@ -14,10 +14,17 @@ const tmbId = '65f000000000000000000062';
const appId = '65f000000000000000000063';
const otherAppId = '65f000000000000000000064';
const legacyUniqueIndexNames = ['appId_1_chatId_1', 'sourceType_1_appId_1_chatId_1'] as const;
const duplicateBlockingUniqueIndexNames = [
'appId_1_chatId_1',
'sourceType_1_appId_1_chatId_1'
] as const;
const ensureLegacyDuplicateWritableCollection = async () => {
for (const indexName of legacyUniqueIndexNames) {
// Mongoose may still be building schema indexes in the background when this file starts.
// Wait first, then drop the unique indexes that intentionally prevent legacy duplicates.
await MongoChat.init();
for (const indexName of duplicateBlockingUniqueIndexNames) {
try {
await MongoChat.collection.dropIndex(indexName);
} catch (error) {
......@@ -29,6 +36,10 @@ const ensureLegacyDuplicateWritableCollection = async () => {
}
};
const restoreChatSchemaIndexes = async () => {
await MongoChat.syncIndexes();
};
const createChatHeader = ({
id,
sourceId = appId,
......@@ -65,6 +76,10 @@ describe('cleanupDuplicateChats data clean API', () => {
await ensureLegacyDuplicateWritableCollection();
});
afterAll(async () => {
await restoreChatSchemaIndexes();
});
it('dry-runs duplicate chat headers without deleting data', async () => {
await MongoChat.collection.insertMany([
createChatHeader({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment