Commit 549230b0 by Archer Committed by GitHub

Doc (#7471)

* doc

* doc

* doc
parent ff0a76a1
......@@ -182,7 +182,7 @@ services:
retries: 3
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.6
ports:
- 3002:3000
networks:
......@@ -248,7 +248,7 @@ services:
<<: [*x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.1.0-beta1
container_name: fastgpt-plugin
restart: always
network_mode: host
......@@ -310,7 +310,7 @@ services:
# 浏览器与 OpenSandbox 之间的 WebSocket 鉴权代理
fastgpt-agent-sandbox-proxy:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.2.0
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.3.0-beta4
container_name: fastgpt-agent-sandbox-proxy
restart: always
ports:
......@@ -332,7 +332,7 @@ services:
# Pre-pull only: not started by `docker compose up` (uses profile `prepull`).
opensandbox-agent-sandbox-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.3.0-beta4
profiles:
- prepull
opensandbox-execd-image:
......@@ -345,7 +345,7 @@ services:
- prepull
# 卷管理微服务:负责幂等创建/删除 Docker named volume 或 k8s PVC
fastgpt-volume-manager:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager:v0.2.0
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager:v0.3.0-beta4
container_name: fastgpt-volume-manager
restart: always
ports:
......
......@@ -182,7 +182,7 @@ services:
retries: 3
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.4
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.6
ports:
- 3002:3000
networks:
......@@ -248,7 +248,7 @@ services:
<<: [*x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.2
image: ghcr.io/labring/fastgpt-plugin:v1.1.0-beta1
container_name: fastgpt-plugin
restart: always
network_mode: host
......@@ -310,7 +310,7 @@ services:
# 浏览器与 OpenSandbox 之间的 WebSocket 鉴权代理
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.2.0
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.3.0-beta4
container_name: fastgpt-agent-sandbox-proxy
restart: always
ports:
......@@ -332,7 +332,7 @@ services:
# Pre-pull only: not started by `docker compose up` (uses profile `prepull`).
opensandbox-agent-sandbox-image:
image: ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0
image: ghcr.io/labring/fastgpt-agent-sandbox:v0.3.0-beta4
profiles:
- prepull
opensandbox-execd-image:
......@@ -345,7 +345,7 @@ services:
- prepull
# 卷管理微服务:负责幂等创建/删除 Docker named volume 或 k8s PVC
fastgpt-volume-manager:
image: ghcr.io/labring/fastgpt-agent-volume-manager:v0.2.0
image: ghcr.io/labring/fastgpt-agent-volume-manager:v0.3.0-beta4
container_name: fastgpt-volume-manager
restart: always
ports:
......
......@@ -137,6 +137,7 @@ const loadVectorConfigs = async () => {
extra: await readOptionalFile(config.extraFile),
depends: config.dbFile ? ' fastgpt-vector:\n condition: service_healthy' : ''
};
vectors[name].extraEntries = vectors[name].extra ? ` ${vectors[name].extra}` : '';
vectors[name].extraBlock = vectors[name].extra ? `configs:\n ${vectors[name].extra}` : '';
}
......@@ -186,7 +187,7 @@ const loadArgs = (version) => {
* @param {RegionEnum} region
* @param {string | undefined} vec
* @param {Record<ServiceKey, ArgItemType>} args
* @param {Record<string, { filename: string, db: string, config: string, extra: string, extraBlock: string, depends: string }>} vectors
* @param {Record<string, { filename: string, db: string, config: string, extra: string, extraEntries: string, extraBlock: string, depends: string }>} vectors
* @param {string} context
* @returns {string}
*/
......@@ -230,7 +231,9 @@ const replace = (source, region, vec, args, vectors, context) => {
} else if (b === 'image') {
const image = arg.image?.[region];
if (!image) {
throw new Error(`Missing deploy image "${a}.${region}" for ${formatExpr(expr)} in ${context}`);
throw new Error(
`Missing deploy image "${a}.${region}" for ${formatExpr(expr)} in ${context}`
);
}
return image;
}
......@@ -261,11 +264,15 @@ const generateDevFile = async (deployVersions, vectors) => {
await Promise.all([
fs.promises.writeFile(
path.join(process.cwd(), 'dev', 'docker-compose.cn.yml'),
formatYamlOutput(replace(template, 'cn', undefined, args, vectors, 'dev/docker-compose.cn.yml'))
formatYamlOutput(
replace(template, 'cn', undefined, args, vectors, 'dev/docker-compose.cn.yml')
)
),
fs.promises.writeFile(
path.join(process.cwd(), 'dev', 'docker-compose.yml'),
formatYamlOutput(replace(template, 'global', undefined, args, vectors, 'dev/docker-compose.yml'))
formatYamlOutput(
replace(template, 'global', undefined, args, vectors, 'dev/docker-compose.yml')
)
)
]);
......
{
"tags": {
"fastgpt": "v4.15.4",
"fastgpt-plugin": "v1.0.2",
"fastgpt-code-sandbox": "v4.15.4",
"fastgpt": "v4.16.0-beta1",
"fastgpt-plugin": "v1.1.0-beta1",
"fastgpt-code-sandbox": "v4.15.6",
"fastgpt-mcp_server": "v4.14.23",
"volume-manager": "v0.2.0",
"agent-sandbox-image": "v0.2.0",
"agent-sandbox-proxy": "v0.2.0",
"volume-manager": "v0.3.0-beta4",
"agent-sandbox-image": "v0.3.0-beta4",
"agent-sandbox-proxy": "v0.3.0-beta4",
"opensandbox-server": "v0.2.1",
"opensandbox-execd": "v1.0.21",
"opensandbox-egress": "v1.1.4",
......
......@@ -5,12 +5,22 @@
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# Sandbox Proxy HTTP 预览地址,必须填写用户实际访问地址
x-agent-sandbox-preview-proxy-url: &x-agent-sandbox-preview-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt_plugin_auth_token_32char'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -39,8 +49,44 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-plugin,fastgpt-code-sandbox,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-plugin,fastgpt-code-sandbox,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-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
AGENT_SANDBOX_PROVIDER: opensandbox
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的 WebSocket 地址。
AGENT_SANDBOX_PROXY_URL: *x-agent-sandbox-proxy-url
# 浏览器访问 Sandbox 文件预览的 HTTP(S) 地址。
AGENT_SANDBOX_PREVIEW_PROXY_URL: *x-agent-sandbox-preview-proxy-url
# 沙盒规模大小
AGENT_SANDBOX_CPU_COUNT: 1
AGENT_SANDBOX_MEMORY_MIB: 2048
AGENT_SANDBOX_STORAGE_SIZE_GI: 1
# 不活跃判断阈值
AGENT_SANDBOX_SUSPEND_MINUTES: 60
# 长期不活跃判断阈值
AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS: 7
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# 自定义 npm/pip 源
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# Opensandox 配置
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE: ${{agent-sandbox-image.image}}:${{agent-sandbox-image.tag}}
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX: fastgpt-session
# Sealos devbox 配置
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE:
# 向量库相关配置
x-vec-config: &x-vec-config
......@@ -158,11 +204,11 @@ services:
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-share-db-config, *x-vec-config, *x-log-config, *x-no-proxy-config, *x-agent-sandbox-config]
HOSTNAME: 0.0.0.0
# ==================== 基础配置 ====================
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# root key(最高权限)
ROOT_KEY: *x-system-key
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
......@@ -193,11 +239,9 @@ services:
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
PASSWORD_LOGIN_MINUTE_LIMIT_COUNT:
# MCP Server 代理地址,用于 MCP 使用方式页拼接 SSE 地址
SSE_MCP_SERVER_PROXY_ENDPOINT:
# 官网访客归因 CRM;地址需包含 /api/v1,为空时不进行身份上报
CRM_API_URL:
CRM_API_KEY:
# ==================== 日志与监控 ====================
# 传递给 OTLP 收集器的服务名称
......@@ -320,6 +364,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: ${{opensandbox-server.image}}:${{opensandbox-server.tag}}
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: ${{volume-manager.image}}:${{volume-manager.tag}}
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: ${{agent-sandbox-image.image}}:${{agent-sandbox-image.tag}}
profiles:
- prepull
opensandbox-execd-image:
image: ${{opensandbox-execd.image}}:${{opensandbox-execd.tag}}
profiles:
- prepull
opensandbox-egress-image:
image: ${{opensandbox-egress.image}}:${{opensandbox-egress.tag}}
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: ${{agent-sandbox-proxy.image}}:${{agent-sandbox-proxy.tag}}
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: ${{aiproxy.image}}:${{aiproxy.tag}}
......@@ -392,4 +520,26 @@ volumes:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
# ${{vec.extraBlock}}
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "${{opensandbox-execd.image}}:${{opensandbox-execd.tag}}"
[egress]
image = "${{opensandbox-egress.image}}:${{opensandbox-egress.tag}}"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
# ${{vec.extraEntries}}
{
"tags": {
"fastgpt": "v4.15.4",
"fastgpt-plugin": "v1.0.2",
"fastgpt": "v4.15.7",
"fastgpt-plugin": "v1.0.3",
"fastgpt-code-sandbox": "v4.15.4",
"fastgpt-code-sandbox": "v4.15.7",
"fastgpt-mcp_server": "v4.14.23",
"volume-manager": "v0.2.0",
"agent-sandbox-image": "v0.2.0",
"agent-sandbox-proxy": "v0.2.0",
"opensandbox-server": "v0.2.0",
"opensandbox-execd": "v1.0.21",
"opensandbox-egress": "v1.1.4",
"aiproxy": "v0.6.5",
"aiproxy-pg": "0.8.0-pg15",
......@@ -25,6 +32,12 @@
"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": "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server",
"opensandbox-execd": "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd",
"opensandbox-egress": "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/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",
......@@ -42,6 +55,12 @@
"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",
......
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - Agent Sandbox Proxy 端口映射为 3006:1006
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# 文件阅读 token 密钥
......@@ -20,6 +24,8 @@ x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-token-please-change'
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -55,8 +61,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 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
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,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
......@@ -69,29 +75,25 @@ x-fastgpt-service-config: &x-fastgpt-service-config
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
# 默认启用 OpenSandbox;如使用其他 provider,请按沙盒配置文档替换相关变量。
AGENT_SANDBOX_PROVIDER: opensandbox
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_PROXY_URL: *x-agent-sandbox-proxy-url
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO:
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG:
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_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_ENTRYPOINT_TIMEOUT_SECONDS: 30
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
......@@ -129,7 +131,7 @@ x-service-env-config: &x-service-env-config
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
AGENT_ENGINE: fastAgent
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 5
......@@ -305,7 +307,7 @@ services:
*x-app-env-config
]
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
......@@ -407,6 +409,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: ${{opensandbox-server.image}}:${{opensandbox-server.tag}}
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: ${{volume-manager.image}}:${{volume-manager.tag}}
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: ${{agent-sandbox-image.image}}:${{agent-sandbox-image.tag}}
profiles:
- prepull
opensandbox-execd-image:
image: ${{opensandbox-execd.image}}:${{opensandbox-execd.tag}}
profiles:
- prepull
opensandbox-egress-image:
image: ${{opensandbox-egress.image}}:${{opensandbox-egress.tag}}
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: ${{agent-sandbox-proxy.image}}:${{agent-sandbox-proxy.tag}}
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: ${{aiproxy.image}}:${{aiproxy.tag}}
......@@ -479,4 +565,26 @@ volumes:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
# ${{vec.extraBlock}}
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "${{opensandbox-execd.image}}:${{opensandbox-execd.tag}}"
[egress]
image = "${{opensandbox-egress.image}}:${{opensandbox-egress.tag}}"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
# ${{vec.extraEntries}}
---
title: General Sandbox Configuration
description: General FastGPT Agent Sandbox configuration
---
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.
## Deploy sandbox-proxy
### 1. Add the yml service
Use [agent-sandbox-proxy.yml](/deploy/sandbox_deploy/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 three environment variables to `fastgpt-app`:
```dotenv
# 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
# Browser-accessible HTTP(S) URL for Sandbox file previews
AGENT_SANDBOX_PREVIEW_PROXY_URL=https://sandbox-proxy.example.com
```
`fastgpt-pro` does not provide the Sandbox Editor or WebSocket proxy path, so it does not require `AGENT_SANDBOX_PROXY_SECRET` or `AGENT_SANDBOX_PROXY_URL`. However, when Agent Sandbox is enabled, you must add `AGENT_SANDBOX_PREVIEW_PROXY_URL` to `fastgpt-pro`. It can use the same value as `fastgpt-app`.
We strongly recommend hosting the preview proxy on an origin separate from the FastGPT application, with a different scheme, host, or port. HTML files in a Sandbox may contain user-generated scripts. If previews share the FastGPT application origin, those scripts run inside the application's same-origin security boundary and may be able to access application credentials or APIs. FastGPT currently validates only that this variable uses `http://` or `https://`; it does not enforce origin isolation.
Preview URLs are temporary, read-only bearer capabilities. Anyone with a URL can change its path to read other files in the same Sandbox Workspace while the URL remains valid. Do not share a preview URL with anyone who should not have access to that Workspace.
### 3. Verify startup
1. Restart `fastgpt-app`, `fastgpt-pro`, and `fastgpt-agent-sandbox-proxy`.
2. Visit `https://agent-proxy-domain/health`. It should return `OK`.
### 4. Deploy a sandbox provider
After deploying the proxy service, connect one of the supported sandbox providers:
- [Sealos Cloud Sandbox](./sealosdevbox)
- [OpenSandbox Deployment](./opensandbox)
## Additional Configuration
### 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.
```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
```
### Resource limit variables
Configure the following variables in `fastgpt-app` and `fastgpt-pro` when you need to adjust resource limits:
| Variable | Default | Description |
| ------------------------------------ | ---------- | ------------------------------------------------------------------------------------------------------------------------ |
| `AGENT_SANDBOX_CPU_COUNT` | `1` | Maximum CPU count for each Agent Sandbox instance. |
| `AGENT_SANDBOX_MEMORY_MIB` | `2048` | Maximum memory for each Agent Sandbox instance, in MiB. |
| `AGENT_SANDBOX_STORAGE_SIZE_GI` | `1` | Agent Sandbox storage size in Gi. FastGPT derives its archive, Skill, and single-file limits as storage in MB / 2 - 150. |
| `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. |
### Lifecycle variables
| Variable | Default | Description |
| ------------------------------------- | ------- | ----------------------------------------------------------------------- |
| `AGENT_SANDBOX_SUSPEND_MINUTES` | `60` | Number of inactive minutes before a running Agent Sandbox is suspended. |
| `AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS` | `7` | Number of inactive days before a suspended Agent Sandbox is archived. |
## FAQ
### AGENT_SANDBOX_PROXY_URL or AGENT_SANDBOX_PREVIEW_PROXY_URL is required
After Agent Sandbox is enabled, `fastgpt-app` requires `AGENT_SANDBOX_PROXY_SECRET`, `AGENT_SANDBOX_PROXY_URL`, and `AGENT_SANDBOX_PREVIEW_PROXY_URL`. `fastgpt-pro` requires only `AGENT_SANDBOX_PREVIEW_PROXY_URL`. You must add the preview proxy URL, such as `https://sandbox-proxy.example.com`, to both services.
### Browser WebSocket connection fails
Check that the proxy service is reachable from the browser and that your reverse proxy supports WebSocket Upgrade. If FastGPT is accessed over HTTPS, `AGENT_SANDBOX_PROXY_URL` should use `wss://` to avoid mixed-content blocking.
### 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.
---
title: 沙盒通用配置
description: FastGPT Agent Sandbox 通用配置
---
本文说明 Agent Sandbox 的通用配置,适用于 `opensandbox` 和 `sealosdevbox`。Provider 自身的接入参数请参考对应 Provider 文档;无论选择哪种 Provider,都需要部署 `fastgpt-agent-sandbox-proxy`,并按需配置沙盒内依赖源。
## 部署 sandbox-proxy
### 1. 添加 yml
可以参考 [agent-sandbox-proxy.yml](/deploy/sandbox_deploy/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` 中增加下面三项环境变量:
```dotenv
# 对应 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
# 浏览器访问 Sandbox 文件预览的 HTTP(S) 地址
AGENT_SANDBOX_PREVIEW_PROXY_URL=https://sandbox-proxy.example.com
```
`fastgpt-pro` 不提供 Sandbox Editor 和 WebSocket proxy 链路,因此不要求 `AGENT_SANDBOX_PROXY_SECRET` 和 `AGENT_SANDBOX_PROXY_URL`,但启用 Agent Sandbox 时必须增加 `AGENT_SANDBOX_PREVIEW_PROXY_URL`。该变量可以与 `fastgpt-app` 使用相同的值。
强烈建议将预览代理部署在与 FastGPT 主站不同的 origin(协议、域名或端口至少一项不同)。Sandbox 中的 HTML 可能包含用户生成的脚本;如果预览地址与 FastGPT 主站同源,这些脚本会处于主站的同源安全边界内,可能访问主站凭证或接口。FastGPT 当前只校验该变量使用 `http://` 或 `https://`,不会强制检查 origin 是否隔离。
预览链接是短期只读 bearer capability。任何获得链接的人都可以在链接有效期内通过修改 URL 路径读取同一 Sandbox Workspace 中的其他文件,因此不要把预览链接分享给不应访问该 Workspace 的用户。
### 3. 启动验证
1. 重启 `fastgpt-app`、`fastgpt-pro` 和 `fastgpt-agent-sandbox-proxy`。
2. 访问 `https://agent-proxy域名/health`,正常返回 `OK`。
### 4. 部署沙盒服务
部署完 proxy 服务后,还需接入沙盒控制服务,目前系统支持以下两种方案:
- [Sealos cloud 沙盒接入](./sealosdevbox)
- [Opensandbox 部署方案](./opensandbox)
## 更多配置
### 自定义源
如果沙盒内需要安装 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
```
### 资源限制变量
`fastpgt-app` 和 `fastgpt-pro` 中你可以通过以下变量控制资源限制:
| 变量 | 默认值 | 说明 |
| ------------------------------------ | ---------- | ------------------------------------------------------------------------------------------------------------- |
| `AGENT_SANDBOX_CPU_COUNT` | `1` | Agent Sandbox 单实例 CPU 核数上限。 |
| `AGENT_SANDBOX_MEMORY_MIB` | `2048` | Agent Sandbox 单实例内存上限,单位 MiB。 |
| `AGENT_SANDBOX_STORAGE_SIZE_GI` | `1` | Agent Sandbox 存储容量,单位 Gi;同时按“存储容量换算为 MB / 2 - 150”计算 FastGPT 的归档、Skill 和单文件限制。 |
| `AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES` | `67108864` | IDE Agent WebSocket 单消息大小上限,单位字节。 |
| `AGENT_SANDBOX_WS_MAX_FRAME_BYTES` | `16777216` | IDE Agent WebSocket 单帧大小上限,单位字节。 |
### 生命周期变量
| 变量 | 默认值 | 说明 |
| ------------------------------------- | ------ | ------------------------------------------------- |
| `AGENT_SANDBOX_SUSPEND_MINUTES` | `60` | 运行中的 Agent 沙箱持续未活跃多少分钟后自动暂停。 |
| `AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS` | `7` | 已暂停的 Agent 沙箱持续未活跃多少天后自动归档。 |
## 常见问题
### 提示 AGENT_SANDBOX_PROXY_URL 或 AGENT_SANDBOX_PREVIEW_PROXY_URL is required
启用 Agent Sandbox 后,`fastgpt-app` 必须配置 `AGENT_SANDBOX_PROXY_SECRET`、`AGENT_SANDBOX_PROXY_URL` 和 `AGENT_SANDBOX_PREVIEW_PROXY_URL`;`fastgpt-pro` 只强制要求 `AGENT_SANDBOX_PREVIEW_PROXY_URL`。两个服务都必须新增预览代理地址,例如 `https://sandbox-proxy.example.com`。
### 浏览器 WebSocket 连接失败
检查代理服务是否能被浏览器访问,并确认反向代理已支持 WebSocket Upgrade。如果 FastGPT 通过 HTTPS 访问,`AGENT_SANDBOX_PROXY_URL` 也应使用 `wss://`,避免浏览器拦截混合内容。
### proxy 校验失败或返回 401
确认 FastGPT 主服务和 `fastgpt-agent-sandbox-proxy` 中的 `AGENT_SANDBOX_PROXY_SECRET` 完全一致,并且长度不少于 32 位。
{
"title": "Sandbox Configuration",
"description": "FastGPT Agent Sandbox deployment configuration",
"pages": ["common", "sealosdevbox", "opensandbox"]
"description": "FastGPT Agent Sandbox configuration",
"pages": ["opensandbox", "sealosdevbox"]
}
{
"title": "沙盒配置",
"description": "FastGPT Agent Sandbox 部署配置",
"pages": ["common", "sealosdevbox", "opensandbox"]
"description": "FastGPT Agent Sandbox 配置",
"pages": ["opensandbox", "sealosdevbox"]
}
---
title: OpenSandbox Deployment
description: Use self-hosted OpenSandbox with FastGPT Agent Sandbox
title: OpenSandbox Configuration
description: Configure OpenSandbox and Agent Sandbox Proxy for FastGPT
---
import { Alert } from '@/components/docs/Alert';
<Alert icon="⚠️" context="warning">
Note: The OpenSandbox setup does not provide network isolation by default. Add your own network
isolation policy if your deployment requires it.
OpenSandbox does not provide network isolation by default. Add your own network isolation policy
if your environment requires it.
</Alert>
OpenSandbox is suitable when you want to self-host the Agent/Skill sandbox runtime. Before starting, complete [General Sandbox Configuration](./common) and make sure `fastgpt-agent-sandbox-proxy` is deployed. Configure the proxy secret, WebSocket URL, and preview URL in `fastgpt-app`; you must configure the preview URL in `fastgpt-pro`.
OpenSandbox is designed for self-hosted Agent and Skill sandbox runtimes. FastGPT creates sandboxes through OpenSandbox Server, while Agent Sandbox Proxy provides browser access to files, terminals, and previews.
<Alert icon="⚠️" context="warning">
When upgrading from an earlier Volume Manager release, set
`AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX` to the previous `VM_VOLUME_NAME_PREFIX` value so
existing persistent volumes can still be cleaned up by their original names.
</Alert>
## Docker Compose Configuration
The latest Docker Compose file already includes OpenSandbox Server, Volume Manager, Agent Sandbox Proxy, and the sandbox runtime images. You do not need to merge any additional YAML files.
The OpenSandbox setup flow is below.
[View the latest docker-compose.yml (PgVector, global registries)](/deploy/docker/main/global/docker-compose.pg.yml)
## 1. Add yml services
See [Deploy with Docker Compose](../../deploy/docker.en.mdx) for other vector databases and China Mainland registries.
Use [opensandbox.yml](/deploy/sandbox_deploy/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).
## Environment Variables
The sample uses China Mainland image registries. For deployments outside China Mainland, replace them with:
The Docker Compose YAML files include default values. This section documents each variable. This page tracks the latest configuration; older releases may differ, so check the YAML for the corresponding older release when needed.
- `opensandbox/server:v0.2.1`
- `ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0`
- `opensandbox/execd:v1.0.21`
- `opensandbox/egress:v1.1.4`
- `ghcr.io/labring/fastgpt-agent-volume-manager:v0.2.0`
### OpenSandbox Service
## 2. Update OpenSandbox variables
Review these settings in the Compose file for your environment:
Only the following values usually need to be changed:
| Setting | Description |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `x-volume-manager-auth-token` | Volume Manager token. 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].host_ip` | Host address that sandbox endpoints expose to the proxy. Use the host's internal IP or `host.docker.internal`. |
| Docker socket mount | The Docker runtime requires the host Docker socket. The default is `/var/run/docker.sock`; use the actual path if different. |
| 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. |
If the host uses `HTTP_PROXY` or `HTTPS_PROXY`, explicitly set `NO_PROXY` and `no_proxy` for OpenSandbox Server and Volume Manager. Include at least `localhost,127.0.0.1,127.0.0.0/8,fastgpt-app,fastgpt-opensandbox-server,fastgpt-volume-manager,fastgpt-agent-sandbox-proxy,host.docker.internal` so internal requests do not go through the proxy.
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.
### Agent Sandbox Proxy Service
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.
| Variable | Default | Description |
| ---------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `PORT` | `1006` | Proxy container port, mapped to port `3006` on the host by default. |
| `PREVIEW_PORT` | Same as `PORT` | In 4.16, sets a separate HTTP preview listener; update the host port mapping and `AGENT_SANDBOX_PREVIEW_PROXY_URL` accordingly. |
| `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 FastGPT URL used by the proxy. |
| `FASTGPT_APP_REQUEST_TIMEOUT_SECS` | `10` | Timeout for proxy requests to FastGPT, in seconds. Increase for slow cold starts. |
| `RUST_LOG` | `info,fastgpt_agent_sandbox_proxy=debug` | Proxy service log level. |
## 3. Update FastGPT variables
In 4.16, WebSocket and HTTP preview traffic use the same port by default. If your gateway cannot route both protocols on one port, set `PREVIEW_PORT` to another container port (for example, `1007`), change the Compose mapping to `3007:1007`, and point `AGENT_SANDBOX_PREVIEW_PROXY_URL` to port 3007.
Add or update the following environment variables in both `fastgpt-app` and `fastgpt-pro`:
### fastgpt-app Service
Configure these variables in the Compose file's `x-agent-sandbox-config` anchor so `fastgpt-app` and `fastgpt-pro` share the OpenSandbox settings:
```dotenv
# Enable OpenSandbox as the Agent Sandbox provider
AGENT_SANDBOX_PROVIDER=opensandbox
# Internal URL for FastGPT to access OpenSandbox Server
# Internal OpenSandbox Server URL and API key
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=registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
AGENT_SANDBOX_OPENSANDBOX_IMAGE=ghcr.io/labring/fastgpt-agent-sandbox: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.
# Volume Manager URL, token, and persistent volume name prefix
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL=http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN=replace_with_volume_manager_token
# Prefix used by the FastGPT app when generating persistent volume claimName values
AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX=fastgpt-session
# Per-instance Agent Sandbox CPU count and memory limit (MiB)
# Agent Sandbox Proxy settings
AGENT_SANDBOX_PROXY_SECRET=replace_with_32_chars_random_secret
AGENT_SANDBOX_PROXY_URL=wss://sandbox-proxy.example.com
AGENT_SANDBOX_PREVIEW_PROXY_URL=https://sandbox-proxy.example.com
# Per-sandbox resource limits
AGENT_SANDBOX_CPU_COUNT=1
AGENT_SANDBOX_MEMORY_MIB=2048
# OpenSandbox persistent volume size. Effective only when creating new PVCs in Kubernetes mode.
AGENT_SANDBOX_STORAGE_SIZE_GI=1
```
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.
`AGENT_SANDBOX_OPENSANDBOX_API_KEY` must match `[server].api_key`, `AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN` must match `x-volume-manager-auth-token`, and `AGENT_SANDBOX_PROXY_SECRET` must match the same variable in Agent Sandbox Proxy.
## 4. Start and verify
`fastgpt-pro` does not provide the Sandbox Editor or WebSocket proxy path, so it does not require `AGENT_SANDBOX_PROXY_SECRET` or `AGENT_SANDBOX_PROXY_URL`. It still requires `AGENT_SANDBOX_PREVIEW_PROXY_URL`.
1. Pre-pull the sandbox runtime images:
<Alert icon="⚠️" context="warning">
Host the preview proxy on an origin separate from the FastGPT application, using a different
scheme, host, or port. Sandbox HTML may contain user-generated scripts. If previews share the
application origin, those scripts may be able to access application credentials or APIs.
</Alert>
```bash
docker compose --profile prepull pull opensandbox-agent-sandbox-image opensandbox-execd-image opensandbox-egress-image
```
Preview URLs are temporary, read-only bearer capabilities. Anyone with a URL can change its path to read other files in the same Sandbox Workspace while the URL remains valid. Do not share preview URLs with users who should not have access to that Workspace.
2. Start or restart the related services:
When upgrading from an earlier Volume Manager release, set `AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX` to the previous `VM_VOLUME_NAME_PREFIX` value so existing persistent volumes can still be cleaned up by their original names.
```bash
docker compose up -d fastgpt-opensandbox-server fastgpt-volume-manager fastgpt-app fastgpt-pro
```
## Additional Configuration
### Custom Package Registries
3. Check service health inside the container network:
Configure package registries in both `fastgpt-app` and `fastgpt-pro` when sandboxes need to install npm or Python dependencies:
```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); })"
```dotenv
AGENT_SANDBOX_NPM_REGISTRY=https://registry.npmmirror.com
AGENT_SANDBOX_PYPI_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
```
OpenSandbox should return `{"status":"healthy"}`, and `fastgpt-volume-manager` should return a health JSON response. See [General Sandbox Configuration](./common) for Agent Sandbox Proxy verification.
### Resource and Lifecycle Settings
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.
| Variable | Default | Description |
| ------------------------------------- | ---------- | ------------------------------------------------------- |
| `AGENT_SANDBOX_CPU_COUNT` | `1` | Maximum CPU count for each Agent Sandbox. |
| `AGENT_SANDBOX_MEMORY_MIB` | `2048` | Maximum memory for each Agent Sandbox, in MiB. |
| `AGENT_SANDBOX_STORAGE_SIZE_GI` | `1` | Sandbox storage capacity, in Gi. |
| `AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES` | `67108864` | Maximum IDE Agent WebSocket message size. |
| `AGENT_SANDBOX_WS_MAX_FRAME_BYTES` | `16777216` | Maximum IDE Agent WebSocket frame size. |
| `AGENT_SANDBOX_SUSPEND_MINUTES` | `60` | Inactive minutes before a running sandbox is suspended. |
| `AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS` | `7` | Inactive days before a suspended sandbox is archived. |
## 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`.
Check `AGENT_SANDBOX_OPENSANDBOX_API_KEY` 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.
Check `AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL` and `AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN`, and make sure Volume Manager is running.
### AGENT_SANDBOX_PROXY_URL or AGENT_SANDBOX_PREVIEW_PROXY_URL is required
`fastgpt-app` requires `AGENT_SANDBOX_PROXY_SECRET`, `AGENT_SANDBOX_PROXY_URL`, and `AGENT_SANDBOX_PREVIEW_PROXY_URL`. `fastgpt-pro` requires `AGENT_SANDBOX_PREVIEW_PROXY_URL`.
### Browser WebSocket connection fails
Check that the proxy is reachable from the browser and that your reverse proxy supports WebSocket Upgrade. If FastGPT uses HTTPS, `AGENT_SANDBOX_PROXY_URL` should use `wss://`.
### Proxy validation fails or returns 401
Make sure `AGENT_SANDBOX_PROXY_SECRET` is identical in FastGPT and Agent Sandbox Proxy and contains at least 32 characters.
### The sandbox is created, but the file tree or terminal fails to connect
### The sandbox is created, but the file tree or terminal does not 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://`.
Make sure `AGENT_SANDBOX_PROXY_URL` is a browser-accessible `ws://` or `wss://` URL, and verify that host port `3006` or the corresponding domain is accessible.
### proxy cannot connect to the sandbox endpoint
### 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`.
Check `[docker].host_ip` in `opensandbox-config`. Sandbox endpoints that use `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
title: OpenSandbox 配置
description: FastGPT OpenSandbox 与 Agent Sandbox Proxy 配置
---
import { Alert } from '@/components/docs/Alert';
<Alert icon="⚠️" context="warning">
注意:OpenSandbox 方案默认未做网络隔离。如需网络隔离,请自行补充对应的网络隔离策略。
OpenSandbox 方案默认未做网络隔离。如有安全隔离要求,请自行补充网络隔离策略。
</Alert>
OpenSandbox 适合需要自托管 Agent/Skill 沙盒运行环境的场景。开始前,请先完成[沙盒通用配置](./common),确保 `fastgpt-agent-sandbox-proxy` 已部署;`fastgpt-app` 需配置 Proxy Secret、WebSocket URL 和预览 URL,`fastgpt-pro` 必须配置预览 URL
OpenSandbox 适合需要自托管 Agent/Skill 沙盒运行环境的场景。FastGPT 通过 OpenSandbox Server 创建沙盒,并通过 Agent Sandbox Proxy 为浏览器提供文件、终端和预览访问能力
<Alert icon="⚠️" context="warning">
从旧版 Volume Manager 升级时,请将原 `VM_VOLUME_NAME_PREFIX` 的值配置到
`AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX`,避免历史持久卷无法按原名称清理。
</Alert>
## Docker Compose 配置
最新版 Docker Compose 已经包含 OpenSandbox Server、Volume Manager、Agent Sandbox Proxy 和沙盒运行时镜像配置,无需再单独合并其他 YAML 文件。
下面是 OpenSandbox 部署和配置流程。
[查看最新版 docker-compose.yml(PgVector,中国大陆镜像源)](/deploy/docker/main/cn/docker-compose.pg.yml)
## 1. 添加 yml service
其他向量数据库和全球镜像源版本见 [Docker Compose 部署](../../deploy/docker)。
参考 [opensandbox.yml](/deploy/sandbox_deploy/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)单独部署。
## 环境变量配置
下面示例使用国内镜像源。海外部署可将镜像替换为:
Docker compose yml 文件里均已带默认值,这里补充做每个变量的说明。该文档始终是最新配置,旧版的配置可能存在差异,需找旧版的 yml 来看实际变量值。
- `opensandbox/server:v0.2.1`
- `ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0`
- `opensandbox/execd:v1.0.21`
- `opensandbox/egress:v1.1.4`
- `ghcr.io/labring/fastgpt-agent-volume-manager:v0.2.0`
### OpenSandbox 服务
## 2. 修改 OpenSandbox 变量
根据实际部署环境检查 Compose 文件中的以下配置:
根据实际部署环境修改下面变量:
| 配置 | 说明 |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `x-volume-manager-auth-token` | Volume Manager 的认证 Token,需要与 FastGPT 的 `AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN` 一致。 |
| `[server].api_key` | OpenSandbox Server API Key,需要与 FastGPT 的 `AGENT_SANDBOX_OPENSANDBOX_API_KEY` 一致。 |
| `[docker].host_ip` | 沙盒端点对 Proxy 可访问的宿主机地址,通常使用宿主机内网 IP 或 `host.docker.internal`。 |
| Docker socket 挂载 | Docker runtime 需要挂载宿主机 Docker socket,默认是 `/var/run/docker.sock`;OrbStack 等环境需替换为实际 socket。 |
| 配置 | 说明 |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `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` 一致。 |
如果服务器配置了 `HTTP_PROXY` / `HTTPS_PROXY`,建议给 OpenSandbox Server 和 Volume Manager 显式配置 `NO_PROXY` / `no_proxy`。至少包含 `localhost,127.0.0.1,127.0.0.0/8,fastgpt-app,fastgpt-opensandbox-server,fastgpt-volume-manager,fastgpt-agent-sandbox-proxy,host.docker.internal`,避免内部服务调用经过代理。
Docker runtime 必须挂载宿主机 Docker socket。Docker 默认路径通常是 `/var/run/docker.sock`;OrbStack 等环境需要替换为实际 socket 路径。
### Agent Sandbox Proxy 服务
如果服务器配置了 `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`。
| 变量 | 默认值 | 说明 |
| ---------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `PORT` | `1006` | Proxy 容器监听端口,默认映射到宿主机 `3006`。 |
| `PREVIEW_PORT` | 与 `PORT` 相同 | 4.16 可单独指定 HTTP 预览监听端口;修改后需同步调整宿主机端口映射和 `AGENT_SANDBOX_PREVIEW_PROXY_URL`。 |
| `AGENT_SANDBOX_PROXY_SECRET` | 无 | 与 FastGPT 主服务共用的密钥,至少 32 位。 |
| `FASTGPT_APP_URL` | `http://fastgpt-app:3000` | Proxy 回源 FastGPT 主服务的内网地址。 |
| `FASTGPT_APP_REQUEST_TIMEOUT_SECS` | `10` | Proxy 回源请求超时时间,单位秒;沙盒冷启动较慢时可适当调大。 |
| `RUST_LOG` | `info,fastgpt_agent_sandbox_proxy=debug` | Proxy 服务日志级别。 |
## 3. 修改 FastGPT 相关变量
4.16 默认使用同一个端口提供 WebSocket 和 HTTP 预览。如果网关不支持同端口转发,可设置 `PREVIEW_PORT` 为其他容器端口(例如 `1007`),并将 Compose 端口映射改为 `3007:1007`,同时把 `AGENT_SANDBOX_PREVIEW_PROXY_URL` 指向新的 3007 端口。
在 `fastgpt-app` 和 `fastgpt-pro` 中增加或修改下面环境变量:
### fastgpt-app 服务
在 Compose 文件的 `x-agent-sandbox-config` 中配置以下变量,使 `fastgpt-app` 和 `fastgpt-pro` 共用 OpenSandbox 配置:
```dotenv
# 启用 OpenSandbox 作为 Agent Sandbox provider
AGENT_SANDBOX_PROVIDER=opensandbox
# FastGPT 主服务访问 OpenSandbox Server 的内网地址
# 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=registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY=true
# 持久卷管理服务地址和 Token,需要与 x-volume-manager-auth-token 一致。
# Volume Manager 地址、Token 和持久卷名称前缀
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL=http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN=replace_with_volume_manager_token
# FastGPT app 生成持久卷 claimName 时使用的前缀
AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX=fastgpt-session
# Agent Sandbox 单实例 CPU 核数和内存上限(MiB)
# Agent Sandbox Proxy 配置
AGENT_SANDBOX_PROXY_SECRET=replace_with_32_chars_random_secret
AGENT_SANDBOX_PROXY_URL=wss://sandbox-proxy.example.com
AGENT_SANDBOX_PREVIEW_PROXY_URL=https://sandbox-proxy.example.com
# 单个沙盒的资源限制
AGENT_SANDBOX_CPU_COUNT=1
AGENT_SANDBOX_MEMORY_MIB=2048
# OpenSandbox 持久卷容量,仅 K8s 模式下创建新 PVC 时有效
AGENT_SANDBOX_STORAGE_SIZE_GI=1
```
如果你的 `docker-compose.yml` 已经使用 `x-agent-sandbox-config` 统一注入 Agent Sandbox 变量,可直接在该 anchor 中填入上述值,确保 `fastgpt-app` 和 `fastgpt-pro` 都继承该配置
`AGENT_SANDBOX_OPENSANDBOX_API_KEY` 必须与 `[server].api_key` 一致,`AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN` 必须与 `x-volume-manager-auth-token` 一致,`AGENT_SANDBOX_PROXY_SECRET` 必须与 Agent Sandbox Proxy 中的同名变量一致
## 4. 启动验证
`fastgpt-pro` 不提供 Sandbox Editor 和 WebSocket Proxy 链路,因此不要求 `AGENT_SANDBOX_PROXY_SECRET` 和 `AGENT_SANDBOX_PROXY_URL`,但必须配置 `AGENT_SANDBOX_PREVIEW_PROXY_URL`。
1. 预拉取沙盒运行时镜像:
<Alert icon="⚠️" context="warning">
预览代理应部署在与 FastGPT 主站不同的 origin(协议、域名或端口至少一项不同)。Sandbox 中的 HTML
可能包含用户生成的脚本;如果预览地址与主站同源,脚本可能访问主站凭证或接口。
</Alert>
```bash
docker compose --profile prepull pull opensandbox-agent-sandbox-image opensandbox-execd-image opensandbox-egress-image
```
预览链接是短期只读 bearer capability。获得链接的人可以在链接有效期内通过修改 URL 路径读取同一 Sandbox Workspace 中的其他文件,请勿将链接分享给无权访问该 Workspace 的用户。
2. 启动或重启相关服务:
从旧版 Volume Manager 升级时,请将原 `VM_VOLUME_NAME_PREFIX` 的值配置到 `AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX`,避免历史持久卷无法按原名称清理。
```bash
docker compose up -d fastgpt-opensandbox-server fastgpt-volume-manager fastgpt-app fastgpt-pro
```
## 更多配置
### 自定义依赖源
3. 在容器网络内检查服务健康状态
如果沙盒内需要安装 npm 或 Python 依赖,可以在 `fastgpt-app` 和 `fastgpt-pro` 中配置依赖源
```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); })"
```dotenv
AGENT_SANDBOX_NPM_REGISTRY=https://registry.npmmirror.com
AGENT_SANDBOX_PYPI_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
```
正常情况下,OpenSandbox 的健康检查会返回 `{"status":"healthy"}`,`fastgpt-volume-manager` 会返回健康状态 JSON。Agent Sandbox Proxy 的验证方式见[沙盒通用配置](./common)。
### 资源与生命周期
4. 登录 FastGPT,打开支持 Agent Sandbox 的场景,例如 Agent V2 虚拟机、Skill 编辑或 Skill 调试,确认可以正常创建沙盒、打开文件树和终端。
| 变量 | 默认值 | 说明 |
| ------------------------------------- | ---------- | ------------------------------------------ |
| `AGENT_SANDBOX_CPU_COUNT` | `1` | 单个 Agent Sandbox 的 CPU 核数上限。 |
| `AGENT_SANDBOX_MEMORY_MIB` | `2048` | 单个 Agent Sandbox 的内存上限,单位 MiB。 |
| `AGENT_SANDBOX_STORAGE_SIZE_GI` | `1` | 沙盒存储容量,单位 Gi。 |
| `AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES` | `67108864` | IDE Agent WebSocket 单消息大小上限。 |
| `AGENT_SANDBOX_WS_MAX_FRAME_BYTES` | `16777216` | IDE Agent WebSocket 单帧大小上限。 |
| `AGENT_SANDBOX_SUSPEND_MINUTES` | `60` | 运行中的沙盒持续未活跃多少分钟后自动暂停。 |
| `AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS` | `7` | 已暂停的沙盒持续未活跃多少天后自动归档。 |
## 常见问题
### 提示 Sandbox provider apiKey is required for opensandbox
检查 `fastgpt-app` 和 `fastgpt-pro` 是否配置了 `AGENT_SANDBOX_OPENSANDBOX_API_KEY`,并确认它与 `opensandbox-config` 中的 `[server].api_key` 一致。
检查 `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_OPENSANDBOX_VOLUME_MANAGER_URL` 和 `AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN`,并确认 Volume Manager 服务正常运行。
### 提示 AGENT_SANDBOX_PROXY_URL 或 AGENT_SANDBOX_PREVIEW_PROXY_URL is required
`fastgpt-app` 必须配置 `AGENT_SANDBOX_PROXY_SECRET`、`AGENT_SANDBOX_PROXY_URL` 和 `AGENT_SANDBOX_PREVIEW_PROXY_URL`;`fastgpt-pro` 必须配置 `AGENT_SANDBOX_PREVIEW_PROXY_URL`。
### 浏览器 WebSocket 连接失败
检查 Proxy 是否可从浏览器访问,并确认反向代理支持 WebSocket Upgrade。如果 FastGPT 使用 HTTPS,`AGENT_SANDBOX_PROXY_URL` 也应使用 `wss://`。
### Proxy 校验失败或返回 401
确认 FastGPT 主服务和 Agent Sandbox Proxy 中的 `AGENT_SANDBOX_PROXY_SECRET` 完全一致,且长度不少于 32 位。
### 沙盒创建成功,但文件树或终端连接失败
检查 `AGENT_SANDBOX_PROXY_URL` 是否是浏览器可访问的 `ws://` 或 `wss://` 地址,并确认反向代理支持 WebSocket Upgrade。如果 FastGPT 主站使用 HTTPS,proxy 地址也应使用 `wss://`
确认 `AGENT_SANDBOX_PROXY_URL` 是浏览器可访问的 `ws://` 或 `wss://` 地址,并检查宿主机 `3006` 端口或对应域名是否已开放
### proxy 无法连接沙盒 endpoint
### Proxy 无法连接沙盒 endpoint
优先检查 `opensandbox-config` 的 `[docker].host_ip`。当 OpenSandbox Server 运行在容器内时,沙盒 endpoint 里的 `localhost` 或 `127.0.0.1` 对 proxy 容器不可达,通常需要改成宿主机内网 IP 或 `host.docker.internal`。
检查 `opensandbox-config` 的 `[docker].host_ip`。沙盒 endpoint 中的 `localhost` 或 `127.0.0.1` 对 Proxy 容器不可达,通常应改为宿主机内网 IP 或 `host.docker.internal`。
......@@ -14,6 +14,7 @@ import { Alert } from '@/components/docs/Alert';
1. FastGPT commercial edition is deployed, and the team has Agent Sandbox access.
2. Request Sealos Devbox connection details from support: Devbox service URL, access token, and runtime image.
3. Follow [OpenSandbox Configuration](./opensandbox) to deploy `fastgpt-agent-sandbox-proxy`.
## Configure FastGPT Environment Variables
......@@ -41,7 +42,7 @@ AGENT_SANDBOX_STORAGE_SIZE_GI=1
### AGENT_SANDBOX_PROXY_URL or AGENT_SANDBOX_PREVIEW_PROXY_URL is required
After `AGENT_SANDBOX_PROVIDER=sealosdevbox` is enabled, `fastgpt-app` requires both `AGENT_SANDBOX_PROXY_URL` and `AGENT_SANDBOX_PREVIEW_PROXY_URL`, while `fastgpt-pro` requires `AGENT_SANDBOX_PREVIEW_PROXY_URL`. See [General Sandbox Configuration](./common) for details.
After `AGENT_SANDBOX_PROVIDER=sealosdevbox` is enabled, `fastgpt-app` requires `AGENT_SANDBOX_PROXY_SECRET`, `AGENT_SANDBOX_PROXY_URL`, and `AGENT_SANDBOX_PREVIEW_PROXY_URL`, while `fastgpt-pro` requires `AGENT_SANDBOX_PREVIEW_PROXY_URL`. The proxy secret must match the value configured for `fastgpt-agent-sandbox-proxy` and contain at least 32 characters.
### AGENT_SANDBOX_SEALOS_IMAGE is required
......
......@@ -13,6 +13,7 @@ import { Alert } from '@/components/docs/Alert';
1. 已部署 FastGPT 商业版,并确认团队拥有 Agent Sandbox 使用权限。
2. 向客服申请 Sealos Devbox 接入信息:Devbox 服务地址、访问 Token、运行态镜像。
3. 参考 [OpenSandbox 配置](./opensandbox) 部署 `fastgpt-agent-sandbox-proxy` 服务。
## 配置 FastGPT 环境变量
......@@ -40,7 +41,7 @@ AGENT_SANDBOX_STORAGE_SIZE_GI=1
### 提示 AGENT_SANDBOX_PROXY_URL 或 AGENT_SANDBOX_PREVIEW_PROXY_URL is required
启用 `AGENT_SANDBOX_PROVIDER=sealosdevbox` 后,`fastgpt-app` 必须配置 `AGENT_SANDBOX_PROXY_URL` 和 `AGENT_SANDBOX_PREVIEW_PROXY_URL`,`fastgpt-pro` 必须配置 `AGENT_SANDBOX_PREVIEW_PROXY_URL`。具体要求见[沙盒通用配置](./common)
启用 `AGENT_SANDBOX_PROVIDER=sealosdevbox` 后,`fastgpt-app` 必须配置 `AGENT_SANDBOX_PROXY_SECRET`、`AGENT_SANDBOX_PROXY_URL` 和 `AGENT_SANDBOX_PREVIEW_PROXY_URL`,`fastgpt-pro` 必须配置 `AGENT_SANDBOX_PREVIEW_PROXY_URL`。Proxy Secret 需与 `fastgpt-agent-sandbox-proxy` 服务中的值一致,且不少于 32 位
### 提示 AGENT_SANDBOX_SEALOS_IMAGE is required
......
......@@ -132,14 +132,24 @@ Refer to https://doc.fastgpt.cn/deploy/SKILL.md and deploy FastGPT with Docker f
Run in Linux/MacOS/Windows WSL. The script guides you through selecting deployment environment, vector database version, IP address, etc.
```bash
bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh)
FASTGPT_DEPLOY_BASE_URL=https://doc.fastgpt.cn bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh)
```
<CurrentOriginCodeBlockUpdater />
If the documentation site uses a custom domain, an internal domain, or a local address, set `FASTGPT_DEPLOY_BASE_URL` to choose the download source. You can provide either the site root or a URL ending in `/deploy`; the script downloads YAML and `config.json` from that source:
```bash
FASTGPT_DEPLOY_BASE_URL=https://doc.fastgpt.cn bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh)
```
<CurrentOriginCodeBlockUpdater />
Non-interactive mode also requires `FASTGPT_FE_DOMAIN`, the full URL users use to access FastGPT, such as `https://fastgpt.example.com`, and `FASTGPT_SANDBOX_PROXY_URL`, the Sandbox WebSocket URL, such as `wss://sandbox-proxy.example.com`. Version 4.16 also requires `FASTGPT_SANDBOX_PREVIEW_PROXY_URL` for the HTTP preview URL. In interactive mode, the script prompts for the addresses required by each version; 4.15 prompts only for the WebSocket URL.
The script automatically:
- Downloads or copies `docker-compose.yml`.
- Downloads `docker-compose.yml`.
- 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.
......@@ -164,24 +174,26 @@ If you need to pin deployment to a specific `docker-compose.yml` file, we recomm
curl -fsSL https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.pg.yml -o docker-compose.source.yml
```
<CurrentOriginCodeBlockUpdater />
<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.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)
- China mirror (Alibaba Cloud): [docker-compose.pg.yml](/deploy/docker/v4.15/cn/docker-compose.pg.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.pg.yml](/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.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)
- China mirror (Alibaba Cloud): [docker-compose.oceanbase.yml](/deploy/docker/v4.15/cn/docker-compose.oceanbase.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.oceanbase.yml](/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.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)
- China mirror (Alibaba Cloud): [docker-compose.milvus.yml](/deploy/docker/v4.15/cn/docker-compose.milvus.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.milvus.yml](/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.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)
- China mirror (Alibaba Cloud): [docker-compose.zilliz.yml](/deploy/docker/v4.15/cn/docker-compose.zilliz.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.zilliz.yml](/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.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)
- China mirror (Alibaba Cloud): [docker-compose.seekdb.yml](/deploy/docker/v4.15/cn/docker-compose.seekdb.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.seekdb.yml](/deploy/docker/v4.15/global/docker-compose.seekdb.yml)
</details>
......@@ -211,10 +223,19 @@ If you use an internal Harbor, private registry, or image mirror, download `dock
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` 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.
If Agent/Skill Sandbox is enabled, also replace the sandbox-related images in the Compose file and update `AGENT_SANDBOX_SEALOS_IMAGE` or `AGENT_SANDBOX_OPENSANDBOX_IMAGE` so the sandbox provider can pull the matching images. See [OpenSandbox Configuration](../config/sandbox/opensandbox) for details.
### 2. Modify Environment Variables
You must set `FE_DOMAIN` in `fastgpt-app` to the full URL users use to access FastGPT, such as `https://fastgpt.example.com`. It must include a scheme, host, and optional port; do not leave it empty or use an internal container address.
When Agent/Skill Sandbox is enabled, also configure:
- `AGENT_SANDBOX_PROXY_URL`: the browser-accessible Sandbox Proxy WebSocket URL using `ws://` or `wss://`, such as `wss://sandbox-proxy.example.com`, pointing to port 3006.
- Version 4.16 additionally requires `AGENT_SANDBOX_PREVIEW_PROXY_URL`: the browser-accessible HTTP(S) URL for sandbox file previews, such as `https://sandbox-proxy.example.com`, also pointing to port 3006.
The interactive install script prompts for these addresses before the final confirmation.
For `Zilliz version`, you also need credentials — see [Deploy Zilliz Version: Get Account and Credentials](#deploy-zilliz-version-get-account-and-credentials). Other versions can skip to the next step.
### 3. Open External Ports / Configure Domain
......@@ -224,12 +245,16 @@ These ports must be accessible:
1. Port 3000 (FastGPT main service)
2. Port 9000 (S3 service)
3. Port 3003 (FastGPT SSE MCP server service)
4. Port 3006 (FastGPT Agent Sandbox Proxy service)
### 4. Start Containers
Run in the same directory as docker-compose.yml. Ensure `docker-compose` version is 2.17+, or automated commands may fail.
```bash
# Pre-pull all service and sandbox runtime images
docker compose --profile prepull pull
# Start containers
docker compose up -d
```
......
......@@ -132,14 +132,16 @@ brew install orbstack
需要在 Linux/MacOS/Windows WSL 环境下执行,引导用户选择部署环境、向量库版本,IP 地址等。
```bash
bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh)
FASTGPT_DEPLOY_BASE_URL=https://doc.fastgpt.cn bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh)
```
<CurrentOriginCodeBlockUpdater />
非交互模式还必须通过 `FASTGPT_FE_DOMAIN` 指定用户访问 FastGPT 的完整地址,例如 `https://fastgpt.example.com`,并通过 `FASTGPT_SANDBOX_PROXY_URL` 指定沙盒 WebSocket 地址,例如 `wss://sandbox-proxy.example.com`。4.16 还需要通过 `FASTGPT_SANDBOX_PREVIEW_PROXY_URL` 指定 HTTP 预览地址。交互模式下脚本会按版本询问这些地址;4.15 只询问 WebSocket 地址。
脚本会自动完成以下操作:
- 下载或复制 `docker-compose.yml`。
- 下载 `docker-compose.yml`。
- 引导选择 S3 与 MCP 的外部访问地址,并写入配置文件。
- 随机生成 `root` 登录密码、服务间 Token、应用密钥和组件密码,并写入 `docker-compose.yml`。
- 自动检测宿主机 Docker socket 路径,必要时替换 `docker-compose.yml` 中的挂载路径。
......@@ -156,24 +158,26 @@ bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh)
curl -fsSL https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.pg.yml -o docker-compose.source.yml
```
<CurrentOriginCodeBlockUpdater />
<details>
<summary>点击展开查看不同数据库的 docker-compose 配置文件下载地址</summary>
- **Pgvector**
- 中国大陆地区镜像源(阿里云):[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)
- 中国大陆地区镜像源(阿里云):[docker-compose.pg.yml](/deploy/docker/v4.15/cn/docker-compose.pg.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.pg.yml](/deploy/docker/v4.15/global/docker-compose.pg.yml)
- **Oceanbase**
- 中国大陆地区镜像源(阿里云):[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)
- 中国大陆地区镜像源(阿里云):[docker-compose.oceanbase.yml](/deploy/docker/v4.15/cn/docker-compose.oceanbase.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.oceanbase.yml](/deploy/docker/v4.15/global/docker-compose.oceanbase.yml)
- **Milvus**
- 中国大陆地区镜像源(阿里云):[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)
- 中国大陆地区镜像源(阿里云):[docker-compose.milvus.yml](/deploy/docker/v4.15/cn/docker-compose.milvus.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.milvus.yml](/deploy/docker/v4.15/global/docker-compose.milvus.yml)
- **Zilliz**
- 中国大陆地区镜像源(阿里云):[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)
- 中国大陆地区镜像源(阿里云):[docker-compose.zilliz.yml](/deploy/docker/v4.15/cn/docker-compose.zilliz.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.zilliz.yml](/deploy/docker/v4.15/global/docker-compose.zilliz.yml)
- **SeekDB**
- 中国大陆地区镜像源(阿里云):[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)
- 中国大陆地区镜像源(阿里云):[docker-compose.seekdb.yml](/deploy/docker/v4.15/cn/docker-compose.seekdb.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.seekdb.yml](/deploy/docker/v4.15/global/docker-compose.seekdb.yml)
</details>
......@@ -203,10 +207,19 @@ FASTGPT_LOCAL_COMPOSE_PATH=./docker-compose.source.yml bash install.sh
FASTGPT_LOCAL_COMPOSE_PATH=./docker-compose.yml bash install.sh
```
如果启用 Agent/Skill 沙盒,还需要单独部署 `fastgpt-agent-sandbox-proxy`,并同步替换 `AGENT_SANDBOX_SEALOS_IMAGE` 或 `AGENT_SANDBOX_OPENSANDBOX_IMAGE`,确保沙盒 provider 可以拉取 `fastgpt-agent-sandbox` 镜像。v4.15.0 默认部署文件不内置 `fastgpt-agent-sandbox-proxy`,也不会默认启动 OpenSandbox;沙盒 provider 的接入方式见 [V4.15.0 升级说明](../upgrading/4-15/41500.mdx#5-agent-sandbox-部署方案)。
如果启用 Agent/Skill 沙盒,还需要同步替换 Compose 文件中的沙盒相关镜像,以及 `AGENT_SANDBOX_SEALOS_IMAGE` 或 `AGENT_SANDBOX_OPENSANDBOX_IMAGE`,确保沙盒 provider 可以拉取对应镜像。具体配置见 [OpenSandbox 配置](../config/sandbox/opensandbox)。
### 2. 修改环境变量
必须填写 `fastgpt-app` 中的 `FE_DOMAIN`,设置为用户实际访问 FastGPT 的完整地址,例如 `https://fastgpt.example.com`。该地址由协议、主机和可选端口组成,不能留空,也不要填写容器内部地址。
启用 Agent/Skill 沙盒时还必须配置:
- `AGENT_SANDBOX_PROXY_URL`:浏览器访问 Sandbox Proxy 的 WebSocket 地址,使用 `ws://` 或 `wss://`,例如 `wss://sandbox-proxy.example.com`,需要指向 3006 端口。
- 4.16 版本额外配置 `AGENT_SANDBOX_PREVIEW_PROXY_URL`:浏览器访问沙盒文件预览的 HTTP(S) 地址,例如 `https://sandbox-proxy.example.com`,同样需要指向 3006 端口。
使用交互式安装脚本时,脚本会在确认部署前询问这些地址。
对于 `Zilliz 版本` 还需要获取密钥,参考 [部署 Zilliz 版本获取账号和密钥](#部署-zilliz-版本获取账号和密钥), 其他版本可直接下一步。
### 3. 开放外网端口/配置域名
......@@ -216,12 +229,16 @@ FASTGPT_LOCAL_COMPOSE_PATH=./docker-compose.yml bash install.sh
1. 3000 端口(FastGPT 主服务)
2. 9000 端口(S3 服务)
3. 3003 端口(FastGPT SSE MCP server 服务)
4. 3006 端口(FastGPT Agent Sandbox Proxy 服务)
### 4. 启动容器
在 docker-compose.yml 同级目录下执行。请确保 `docker-compose` 版本最好在 2.17 以上,否则可能无法执行自动化命令。
```bash
# 预拉取所有服务及沙盒运行时镜像
docker compose --profile prepull pull
# 启动容器
docker compose up -d
```
......
......@@ -208,13 +208,12 @@ DEPLOYMENT_ENVIRONMENT=
### 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.
See the [4.15 deployment YAML](https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.pg.yml) for the complete OpenSandbox setup. The 4.15 Docker Compose deployment file already includes OpenSandbox Server, Volume Manager, Agent Sandbox Proxy, and the image pre-pull services.
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`.
1. Using the new Docker Compose deployment file, which includes the OpenSandbox services.
2. Updating OpenSandbox environment variables in `fastgpt-app` and `fastgpt-pro`.
You can overwrite your deployment directly with the new OpenSandbox template.
......
......@@ -207,13 +207,12 @@ DEPLOYMENT_ENVIRONMENT=
### 2. OpenSandbox 调整(按需)
Opensandbox 和其他沙盒提供商的配置单独移动到[沙盒配置](../../config/sandbox/common)内,并不再内置到部署 yml 中
OpenSandbox 的完整配置请参考 [4.15 部署 yml](https://doc.fastgpt.cn/deploy/docker/v4.15/cn/docker-compose.pg.yml)。4.15 的 Docker Compose 部署文件已经内置 OpenSandbox Server、Volume Manager、Agent Sandbox Proxy 和预拉取镜像服务
本次升级主要需修改以下内容:
1. 新部署 `agent-sandbox-proxy` 服务。
2. 更新 `opensandbox` 相关镜像版本。
3. 修改 `fastgpt-app` 和 `fastgpt-pro` 里部分环境变量。
1. 使用新版 Docker Compose 部署文件,其中已包含 OpenSandbox 相关服务。
2. 修改 `fastgpt-app` 和 `fastgpt-pro` 里的 OpenSandbox 环境变量。
可以直接按新的 OpenSandbox 模板进行覆盖部署即可。
......
---
title: 'V4.15.7'
description: 'FastGPT V4.15.7 Release Notes'
---
## 📦 Upgrade Guide
### Image Changes
- Update the fastgpt-app (FastGPT core service) image tag to v4.15.7.
- Update the fastgpt-pro (FastGPT commercial edition) image tag to v4.15.7.
## 🐛 Fixes
1. Fixed duplicate request headers when MCP falls back to SSE after a failed Streamable HTTP connection.
2. Limited portal quick apps to 3 and added validation for legacy configurations that contain more than the allowed number.
3. Fixed published apps incorrectly rejecting uploads when file variables allow file uploads but the app-level upload configuration is disabled.
---
title: 'V4.15.7'
description: 'FastGPT V4.15.7 更新说明'
---
## 📦 升级指南
### 镜像变更
- 更新 fastgpt-app(FastGPT 主服务)镜像 tag:v4.15.7
- 更新 fastgpt-pro(FastGPT 商业版)镜像 tag:v4.15.7
## 🐛 修复
1. 修复 MCP 使用 Streamable HTTP 连接失败并回退到 SSE 时,请求头可能被重复发送的问题。
2. 门户页快捷应用数量上限调整为 3 个,并兼容校验历史配置中超过上限的快捷应用。
3. 修复应用发布后,文件变量配置允许上传文件,但预签名上传接口错误判断为未开启文件上传的问题。
{
"title": "4.15.x",
"description": "",
"pages": ["4156", "4155", "4154", "4153", "4152", "4151", "41500", "41507", "41506", "41505", "41504", "41503", "41502", "41501"]
"pages": ["4157", "4156", "4155", "4154", "4153", "4152", "4151", "41500", "41507", "41506", "41505", "41504", "41503", "41502", "41501"]
}
{
"title": "4.15.x",
"description": "",
"pages": ["4156", "4155", "4154", "4153", "4152", "4151", "41500", "41507", "41506", "41505", "41504", "41503", "41502", "41501"]
"pages": ["4157", "4156", "4155", "4154", "4153", "4152", "4151", "41500", "41507", "41506", "41505", "41504", "41503", "41502", "41501"]
}
---
title: 'V4.16.0-beta1 (In Progress)'
title: 'V4.16.0-beta1 (Environment Variable Changes and Upgrade Scripts)'
description: 'FastGPT V4.16.0-beta1 release notes'
---
......@@ -53,12 +53,11 @@ The E2B Sandbox Provider has been removed. Environments previously configured fo
### 3. Update images
To be added...
1. app
2. pro
3. agent-sandbox-volumn
4. agent-sandbox-proxy
- Update the fastgpt-app (FastGPT main service) image tag to `v4.16.0-beta1`
- Update the fastgpt-pro (FastGPT commercial edition) image tag to `v4.16.0-beta1`
- Update the fastgpt-plugin image tag to `v1.1.0-beta1`
- Update the agent-sandbox-volumn image tag to `v0.3.0-beta4` (for OpenSandbox only)
- Update the agent-sandbox-proxy image tag to `v0.3.0-beta4` (for Sandbox only)
### 4. Migrate Agent Sandbox data
......
---
title: 'V4.16.0-beta1(进行中)'
title: 'V4.16.0-beta1(环境变量变更、升级脚本)'
description: 'FastGPT V4.16.0-beta1 更新说明'
---
......@@ -53,12 +53,11 @@ E2B Sandbox Provider 已移除。此前配置过 E2B 的环境需要切换为 `o
### 3. 镜像更新
待补充……
1. app
2. pro
3. agent-sandbox-volumn
4. agent-sandbox-proxy
- 更新 fastgpt-app(fastgpt 主服务) 镜像 tag: v4.16.0-beta1
- 更新 fastgpt-pro(fastgpt 商业版) 镜像 tag: v4.16.0-beta1
- 更新 fastgpt-plugin 镜像 tag: v1.1.0-beta1
- 更新 agent-sandbox-volumn 镜像 tag: v0.3.0-beta4 (Opensandbox 专属)
- 更新 agent-sandbox-proxy 镜像 tag: v0.3.0-beta4 (沙盒专属)
### 4. 迁移 Agent Sandbox 数据
......
......@@ -93,7 +93,6 @@ description: FastGPT Toc
- [/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)
......@@ -168,6 +167,7 @@ description: FastGPT Toc
- [/en/self-host/upgrading/4-15/4154](/en/self-host/upgrading/4-15/4154)
- [/en/self-host/upgrading/4-15/4155](/en/self-host/upgrading/4-15/4155)
- [/en/self-host/upgrading/4-15/4156](/en/self-host/upgrading/4-15/4156)
- [/en/self-host/upgrading/4-15/4157](/en/self-host/upgrading/4-15/4157)
- [/en/self-host/upgrading/4-16/41601](/en/self-host/upgrading/4-16/41601)
- [/en/self-host/upgrading/outdated/40](/en/self-host/upgrading/outdated/40)
- [/en/self-host/upgrading/outdated/41](/en/self-host/upgrading/outdated/41)
......
......@@ -93,7 +93,6 @@ description: FastGPT 文档目录
- [/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)
......@@ -170,6 +169,7 @@ description: FastGPT 文档目录
- [/self-host/upgrading/4-15/4154](/self-host/upgrading/4-15/4154)
- [/self-host/upgrading/4-15/4155](/self-host/upgrading/4-15/4155)
- [/self-host/upgrading/4-15/4156](/self-host/upgrading/4-15/4156)
- [/self-host/upgrading/4-15/4157](/self-host/upgrading/4-15/4157)
- [/self-host/upgrading/4-16/41601](/self-host/upgrading/4-16/41601)
- [/self-host/upgrading/outdated/40](/self-host/upgrading/outdated/40)
- [/self-host/upgrading/outdated/41](/self-host/upgrading/outdated/41)
......
......@@ -169,8 +169,8 @@
"content/plugin/model-presets.mdx": "2026-06-04T16:10:15+08:00",
"content/plugin/system-tool-development.en.mdx": "2026-07-02T11:54:55+08:00",
"content/plugin/system-tool-development.mdx": "2026-07-02T11:54:55+08:00",
"content/self-host/config/env.en.mdx": "2026-08-05T00:04:49+08:00",
"content/self-host/config/env.mdx": "2026-08-05T00:04:49+08:00",
"content/self-host/config/env.en.mdx": "2026-08-05T22:45:40+08:00",
"content/self-host/config/env.mdx": "2026-08-05T22:45:40+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 +181,6 @@
"content/self-host/config/object-storage.mdx": "2026-07-26T21:56:28+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-07-30T15:22:52+08:00",
"content/self-host/config/sandbox/common.mdx": "2026-07-30T15:22:52+08:00",
"content/self-host/config/sandbox/opensandbox.en.mdx": "2026-08-05T18:25:06+08:00",
"content/self-host/config/sandbox/opensandbox.mdx": "2026-08-05T18:25:06+08:00",
"content/self-host/config/sandbox/sealosdevbox.en.mdx": "2026-07-30T15:22:52+08:00",
......@@ -333,8 +331,10 @@
"content/self-host/upgrading/4-15/4155.mdx": "2026-07-30T11:22:58+08:00",
"content/self-host/upgrading/4-15/4156.en.mdx": "2026-07-31T17:46:31+08:00",
"content/self-host/upgrading/4-15/4156.mdx": "2026-07-31T17:46:31+08:00",
"content/self-host/upgrading/4-16/41601.en.mdx": "2026-08-05T19:17:13+08:00",
"content/self-host/upgrading/4-16/41601.mdx": "2026-08-05T19:17:13+08:00",
"content/self-host/upgrading/4-15/4157.en.mdx": "2026-08-07T10:52:25+08:00",
"content/self-host/upgrading/4-15/4157.mdx": "2026-08-07T10:52:25+08:00",
"content/self-host/upgrading/4-16/41601.en.mdx": "2026-08-07T10:36:08+08:00",
"content/self-host/upgrading/4-16/41601.mdx": "2026-08-07T10:36:08+08:00",
"content/self-host/upgrading/outdated/40.en.mdx": "2026-07-25T00:27:20+08:00",
"content/self-host/upgrading/outdated/40.mdx": "2026-07-25T00:27:20+08:00",
"content/self-host/upgrading/outdated/41.en.mdx": "2026-07-25T00:27:20+08:00",
......@@ -475,6 +475,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-08-04T22:08:29+08:00",
"content/toc.mdx": "2026-08-04T22:08:29+08:00"
"content/toc.en.mdx": "2026-08-07T10:52:25+08:00",
"content/toc.mdx": "2026-08-07T10:52:25+08:00"
}
\ No newline at end of file
......@@ -5,12 +5,22 @@
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# Sandbox Proxy HTTP 预览地址,必须填写用户实际访问地址
x-agent-sandbox-preview-proxy-url: &x-agent-sandbox-preview-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt_plugin_auth_token_32char'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -39,8 +49,44 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-plugin,fastgpt-code-sandbox,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-plugin,fastgpt-code-sandbox,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-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
AGENT_SANDBOX_PROVIDER: opensandbox
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的 WebSocket 地址。
AGENT_SANDBOX_PROXY_URL: *x-agent-sandbox-proxy-url
# 浏览器访问 Sandbox 文件预览的 HTTP(S) 地址。
AGENT_SANDBOX_PREVIEW_PROXY_URL: *x-agent-sandbox-preview-proxy-url
# 沙盒规模大小
AGENT_SANDBOX_CPU_COUNT: 1
AGENT_SANDBOX_MEMORY_MIB: 2048
AGENT_SANDBOX_STORAGE_SIZE_GI: 1
# 不活跃判断阈值
AGENT_SANDBOX_SUSPEND_MINUTES: 60
# 长期不活跃判断阈值
AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS: 7
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# 自定义 npm/pip 源
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# Opensandox 配置
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.3.0-beta4
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX: fastgpt-session
# Sealos devbox 配置
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE:
# 向量库相关配置
x-vec-config: &x-vec-config
......@@ -192,7 +238,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.16.0-beta1
ports:
- 3000:3000
networks:
......@@ -216,11 +262,11 @@ services:
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-share-db-config, *x-vec-config, *x-log-config, *x-no-proxy-config, *x-agent-sandbox-config]
HOSTNAME: 0.0.0.0
# ==================== 基础配置 ====================
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# root key(最高权限)
ROOT_KEY: *x-system-key
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
......@@ -251,11 +297,9 @@ services:
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
PASSWORD_LOGIN_MINUTE_LIMIT_COUNT:
# MCP Server 代理地址,用于 MCP 使用方式页拼接 SSE 地址
SSE_MCP_SERVER_PROXY_ENDPOINT:
# 官网访客归因 CRM;地址需包含 /api/v1,为空时不进行身份上报
CRM_API_URL:
CRM_API_KEY:
# ==================== 日志与监控 ====================
# 传递给 OTLP 收集器的服务名称
......@@ -288,7 +332,7 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.6
networks:
- codesandbox
restart: always
......@@ -352,7 +396,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:v1.0.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.1.0-beta1
container_name: fastgpt-plugin
restart: always
networks:
......@@ -378,6 +422,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager:v0.3.0-beta4
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.3.0-beta4
profiles:
- prepull
opensandbox-execd-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.3.0-beta4
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
......@@ -449,3 +577,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21"
[egress]
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
......@@ -5,12 +5,22 @@
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# Sandbox Proxy HTTP 预览地址,必须填写用户实际访问地址
x-agent-sandbox-preview-proxy-url: &x-agent-sandbox-preview-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt_plugin_auth_token_32char'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -39,8 +49,44 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-plugin,fastgpt-code-sandbox,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-plugin,fastgpt-code-sandbox,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-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
AGENT_SANDBOX_PROVIDER: opensandbox
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的 WebSocket 地址。
AGENT_SANDBOX_PROXY_URL: *x-agent-sandbox-proxy-url
# 浏览器访问 Sandbox 文件预览的 HTTP(S) 地址。
AGENT_SANDBOX_PREVIEW_PROXY_URL: *x-agent-sandbox-preview-proxy-url
# 沙盒规模大小
AGENT_SANDBOX_CPU_COUNT: 1
AGENT_SANDBOX_MEMORY_MIB: 2048
AGENT_SANDBOX_STORAGE_SIZE_GI: 1
# 不活跃判断阈值
AGENT_SANDBOX_SUSPEND_MINUTES: 60
# 长期不活跃判断阈值
AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS: 7
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# 自定义 npm/pip 源
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# Opensandox 配置
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.3.0-beta4
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX: fastgpt-session
# Sealos devbox 配置
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE:
# 向量库相关配置
x-vec-config: &x-vec-config
......@@ -170,7 +216,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.16.0-beta1
ports:
- 3000:3000
networks:
......@@ -194,11 +240,11 @@ services:
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-share-db-config, *x-vec-config, *x-log-config, *x-no-proxy-config, *x-agent-sandbox-config]
HOSTNAME: 0.0.0.0
# ==================== 基础配置 ====================
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# root key(最高权限)
ROOT_KEY: *x-system-key
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
......@@ -229,11 +275,9 @@ services:
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
PASSWORD_LOGIN_MINUTE_LIMIT_COUNT:
# MCP Server 代理地址,用于 MCP 使用方式页拼接 SSE 地址
SSE_MCP_SERVER_PROXY_ENDPOINT:
# 官网访客归因 CRM;地址需包含 /api/v1,为空时不进行身份上报
CRM_API_URL:
CRM_API_KEY:
# ==================== 日志与监控 ====================
# 传递给 OTLP 收集器的服务名称
......@@ -266,7 +310,7 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.6
networks:
- codesandbox
restart: always
......@@ -330,7 +374,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:v1.0.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.1.0-beta1
container_name: fastgpt-plugin
restart: always
networks:
......@@ -356,6 +400,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager:v0.3.0-beta4
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.3.0-beta4
profiles:
- prepull
opensandbox-execd-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.3.0-beta4
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
......@@ -429,6 +557,27 @@ volumes:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21"
[egress]
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
init_sql:
name: init_sql
content: |
......
......@@ -5,12 +5,22 @@
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# Sandbox Proxy HTTP 预览地址,必须填写用户实际访问地址
x-agent-sandbox-preview-proxy-url: &x-agent-sandbox-preview-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt_plugin_auth_token_32char'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -39,8 +49,44 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-plugin,fastgpt-code-sandbox,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-plugin,fastgpt-code-sandbox,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-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
AGENT_SANDBOX_PROVIDER: opensandbox
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的 WebSocket 地址。
AGENT_SANDBOX_PROXY_URL: *x-agent-sandbox-proxy-url
# 浏览器访问 Sandbox 文件预览的 HTTP(S) 地址。
AGENT_SANDBOX_PREVIEW_PROXY_URL: *x-agent-sandbox-preview-proxy-url
# 沙盒规模大小
AGENT_SANDBOX_CPU_COUNT: 1
AGENT_SANDBOX_MEMORY_MIB: 2048
AGENT_SANDBOX_STORAGE_SIZE_GI: 1
# 不活跃判断阈值
AGENT_SANDBOX_SUSPEND_MINUTES: 60
# 长期不活跃判断阈值
AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS: 7
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# 自定义 npm/pip 源
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# Opensandox 配置
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.3.0-beta4
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX: fastgpt-session
# Sealos devbox 配置
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE:
# 向量库相关配置
x-vec-config: &x-vec-config
......@@ -154,7 +200,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.16.0-beta1
ports:
- 3000:3000
networks:
......@@ -178,11 +224,11 @@ services:
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-share-db-config, *x-vec-config, *x-log-config, *x-no-proxy-config, *x-agent-sandbox-config]
HOSTNAME: 0.0.0.0
# ==================== 基础配置 ====================
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# root key(最高权限)
ROOT_KEY: *x-system-key
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
......@@ -213,11 +259,9 @@ services:
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
PASSWORD_LOGIN_MINUTE_LIMIT_COUNT:
# MCP Server 代理地址,用于 MCP 使用方式页拼接 SSE 地址
SSE_MCP_SERVER_PROXY_ENDPOINT:
# 官网访客归因 CRM;地址需包含 /api/v1,为空时不进行身份上报
CRM_API_URL:
CRM_API_KEY:
# ==================== 日志与监控 ====================
# 传递给 OTLP 收集器的服务名称
......@@ -250,7 +294,7 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.6
networks:
- codesandbox
restart: always
......@@ -314,7 +358,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:v1.0.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.1.0-beta1
container_name: fastgpt-plugin
restart: always
networks:
......@@ -340,6 +384,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager:v0.3.0-beta4
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.3.0-beta4
profiles:
- prepull
opensandbox-execd-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.3.0-beta4
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
......@@ -411,3 +539,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21"
[egress]
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
......@@ -5,12 +5,22 @@
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# Sandbox Proxy HTTP 预览地址,必须填写用户实际访问地址
x-agent-sandbox-preview-proxy-url: &x-agent-sandbox-preview-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt_plugin_auth_token_32char'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -39,8 +49,44 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-plugin,fastgpt-code-sandbox,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-plugin,fastgpt-code-sandbox,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-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
AGENT_SANDBOX_PROVIDER: opensandbox
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的 WebSocket 地址。
AGENT_SANDBOX_PROXY_URL: *x-agent-sandbox-proxy-url
# 浏览器访问 Sandbox 文件预览的 HTTP(S) 地址。
AGENT_SANDBOX_PREVIEW_PROXY_URL: *x-agent-sandbox-preview-proxy-url
# 沙盒规模大小
AGENT_SANDBOX_CPU_COUNT: 1
AGENT_SANDBOX_MEMORY_MIB: 2048
AGENT_SANDBOX_STORAGE_SIZE_GI: 1
# 不活跃判断阈值
AGENT_SANDBOX_SUSPEND_MINUTES: 60
# 长期不活跃判断阈值
AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS: 7
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# 自定义 npm/pip 源
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# Opensandox 配置
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.3.0-beta4
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX: fastgpt-session
# Sealos devbox 配置
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE:
# 向量库相关配置
x-vec-config: &x-vec-config
......@@ -152,7 +198,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.16.0-beta1
ports:
- 3000:3000
networks:
......@@ -176,11 +222,11 @@ services:
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-share-db-config, *x-vec-config, *x-log-config, *x-no-proxy-config, *x-agent-sandbox-config]
HOSTNAME: 0.0.0.0
# ==================== 基础配置 ====================
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# root key(最高权限)
ROOT_KEY: *x-system-key
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
......@@ -211,11 +257,9 @@ services:
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
PASSWORD_LOGIN_MINUTE_LIMIT_COUNT:
# MCP Server 代理地址,用于 MCP 使用方式页拼接 SSE 地址
SSE_MCP_SERVER_PROXY_ENDPOINT:
# 官网访客归因 CRM;地址需包含 /api/v1,为空时不进行身份上报
CRM_API_URL:
CRM_API_KEY:
# ==================== 日志与监控 ====================
# 传递给 OTLP 收集器的服务名称
......@@ -248,7 +292,7 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.6
networks:
- codesandbox
restart: always
......@@ -312,7 +356,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:v1.0.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.1.0-beta1
container_name: fastgpt-plugin
restart: always
networks:
......@@ -338,6 +382,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager:v0.3.0-beta4
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.3.0-beta4
profiles:
- prepull
opensandbox-execd-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.3.0-beta4
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
......@@ -409,3 +537,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21"
[egress]
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
......@@ -5,12 +5,22 @@
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# Sandbox Proxy HTTP 预览地址,必须填写用户实际访问地址
x-agent-sandbox-preview-proxy-url: &x-agent-sandbox-preview-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt_plugin_auth_token_32char'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -39,8 +49,44 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-plugin,fastgpt-code-sandbox,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-plugin,fastgpt-code-sandbox,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-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
AGENT_SANDBOX_PROVIDER: opensandbox
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的 WebSocket 地址。
AGENT_SANDBOX_PROXY_URL: *x-agent-sandbox-proxy-url
# 浏览器访问 Sandbox 文件预览的 HTTP(S) 地址。
AGENT_SANDBOX_PREVIEW_PROXY_URL: *x-agent-sandbox-preview-proxy-url
# 沙盒规模大小
AGENT_SANDBOX_CPU_COUNT: 1
AGENT_SANDBOX_MEMORY_MIB: 2048
AGENT_SANDBOX_STORAGE_SIZE_GI: 1
# 不活跃判断阈值
AGENT_SANDBOX_SUSPEND_MINUTES: 60
# 长期不活跃判断阈值
AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS: 7
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# 自定义 npm/pip 源
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# Opensandox 配置
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.3.0-beta4
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX: fastgpt-session
# Sealos devbox 配置
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE:
# 向量库相关配置
x-vec-config: &x-vec-config
......@@ -157,7 +203,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.16.0-beta1
ports:
- 3000:3000
networks:
......@@ -181,11 +227,11 @@ services:
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-share-db-config, *x-vec-config, *x-log-config, *x-no-proxy-config, *x-agent-sandbox-config]
HOSTNAME: 0.0.0.0
# ==================== 基础配置 ====================
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# root key(最高权限)
ROOT_KEY: *x-system-key
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
......@@ -216,11 +262,9 @@ services:
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
PASSWORD_LOGIN_MINUTE_LIMIT_COUNT:
# MCP Server 代理地址,用于 MCP 使用方式页拼接 SSE 地址
SSE_MCP_SERVER_PROXY_ENDPOINT:
# 官网访客归因 CRM;地址需包含 /api/v1,为空时不进行身份上报
CRM_API_URL:
CRM_API_KEY:
# ==================== 日志与监控 ====================
# 传递给 OTLP 收集器的服务名称
......@@ -253,7 +297,7 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.6
networks:
- codesandbox
restart: always
......@@ -317,7 +361,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:v1.0.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.1.0-beta1
container_name: fastgpt-plugin
restart: always
networks:
......@@ -343,6 +387,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager:v0.3.0-beta4
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.3.0-beta4
profiles:
- prepull
opensandbox-execd-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.3.0-beta4
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
......@@ -414,3 +542,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21"
[egress]
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
......@@ -5,12 +5,22 @@
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# Sandbox Proxy HTTP 预览地址,必须填写用户实际访问地址
x-agent-sandbox-preview-proxy-url: &x-agent-sandbox-preview-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt_plugin_auth_token_32char'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -39,8 +49,44 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-plugin,fastgpt-code-sandbox,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-plugin,fastgpt-code-sandbox,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-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
AGENT_SANDBOX_PROVIDER: opensandbox
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的 WebSocket 地址。
AGENT_SANDBOX_PROXY_URL: *x-agent-sandbox-proxy-url
# 浏览器访问 Sandbox 文件预览的 HTTP(S) 地址。
AGENT_SANDBOX_PREVIEW_PROXY_URL: *x-agent-sandbox-preview-proxy-url
# 沙盒规模大小
AGENT_SANDBOX_CPU_COUNT: 1
AGENT_SANDBOX_MEMORY_MIB: 2048
AGENT_SANDBOX_STORAGE_SIZE_GI: 1
# 不活跃判断阈值
AGENT_SANDBOX_SUSPEND_MINUTES: 60
# 长期不活跃判断阈值
AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS: 7
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# 自定义 npm/pip 源
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# Opensandox 配置
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.3.0-beta4
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX: fastgpt-session
# Sealos devbox 配置
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE:
# 向量库相关配置
x-vec-config: &x-vec-config
......@@ -135,7 +181,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.16.0-beta1
ports:
- 3000:3000
networks:
......@@ -157,11 +203,11 @@ services:
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-share-db-config, *x-vec-config, *x-log-config, *x-no-proxy-config, *x-agent-sandbox-config]
HOSTNAME: 0.0.0.0
# ==================== 基础配置 ====================
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# root key(最高权限)
ROOT_KEY: *x-system-key
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
......@@ -192,11 +238,9 @@ services:
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
PASSWORD_LOGIN_MINUTE_LIMIT_COUNT:
# MCP Server 代理地址,用于 MCP 使用方式页拼接 SSE 地址
SSE_MCP_SERVER_PROXY_ENDPOINT:
# 官网访客归因 CRM;地址需包含 /api/v1,为空时不进行身份上报
CRM_API_URL:
CRM_API_KEY:
# ==================== 日志与监控 ====================
# 传递给 OTLP 收集器的服务名称
......@@ -229,7 +273,7 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.6
networks:
- codesandbox
restart: always
......@@ -293,7 +337,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:v1.0.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.1.0-beta1
container_name: fastgpt-plugin
restart: always
networks:
......@@ -319,6 +363,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager:v0.3.0-beta4
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.3.0-beta4
profiles:
- prepull
opensandbox-execd-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.3.0-beta4
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
......@@ -390,3 +518,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21"
[egress]
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
......@@ -5,12 +5,22 @@
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# Sandbox Proxy HTTP 预览地址,必须填写用户实际访问地址
x-agent-sandbox-preview-proxy-url: &x-agent-sandbox-preview-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt_plugin_auth_token_32char'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -39,8 +49,44 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-plugin,fastgpt-code-sandbox,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-plugin,fastgpt-code-sandbox,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-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
AGENT_SANDBOX_PROVIDER: opensandbox
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的 WebSocket 地址。
AGENT_SANDBOX_PROXY_URL: *x-agent-sandbox-proxy-url
# 浏览器访问 Sandbox 文件预览的 HTTP(S) 地址。
AGENT_SANDBOX_PREVIEW_PROXY_URL: *x-agent-sandbox-preview-proxy-url
# 沙盒规模大小
AGENT_SANDBOX_CPU_COUNT: 1
AGENT_SANDBOX_MEMORY_MIB: 2048
AGENT_SANDBOX_STORAGE_SIZE_GI: 1
# 不活跃判断阈值
AGENT_SANDBOX_SUSPEND_MINUTES: 60
# 长期不活跃判断阈值
AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS: 7
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# 自定义 npm/pip 源
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# Opensandox 配置
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE: ghcr.io/labring/fastgpt-agent-sandbox:v0.3.0-beta4
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX: fastgpt-session
# Sealos devbox 配置
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE:
# 向量库相关配置
x-vec-config: &x-vec-config
......@@ -192,7 +238,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.4
image: ghcr.io/labring/fastgpt:v4.16.0-beta1
ports:
- 3000:3000
networks:
......@@ -216,11 +262,11 @@ services:
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-share-db-config, *x-vec-config, *x-log-config, *x-no-proxy-config, *x-agent-sandbox-config]
HOSTNAME: 0.0.0.0
# ==================== 基础配置 ====================
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# root key(最高权限)
ROOT_KEY: *x-system-key
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
......@@ -251,11 +297,9 @@ services:
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
PASSWORD_LOGIN_MINUTE_LIMIT_COUNT:
# MCP Server 代理地址,用于 MCP 使用方式页拼接 SSE 地址
SSE_MCP_SERVER_PROXY_ENDPOINT:
# 官网访客归因 CRM;地址需包含 /api/v1,为空时不进行身份上报
CRM_API_URL:
CRM_API_KEY:
# ==================== 日志与监控 ====================
# 传递给 OTLP 收集器的服务名称
......@@ -288,7 +332,7 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.4
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.6
networks:
- codesandbox
restart: always
......@@ -352,7 +396,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.2
image: ghcr.io/labring/fastgpt-plugin:v1.1.0-beta1
container_name: fastgpt-plugin
restart: always
networks:
......@@ -378,6 +422,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: ghcr.io/labring/fastgpt-agent-volume-manager:v0.3.0-beta4
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: ghcr.io/labring/fastgpt-agent-sandbox:v0.3.0-beta4
profiles:
- prepull
opensandbox-execd-image:
image: opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.3.0-beta4
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
......@@ -449,3 +577,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "opensandbox/execd:v1.0.21"
[egress]
image = "opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
......@@ -5,12 +5,22 @@
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# Sandbox Proxy HTTP 预览地址,必须填写用户实际访问地址
x-agent-sandbox-preview-proxy-url: &x-agent-sandbox-preview-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt_plugin_auth_token_32char'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -39,8 +49,44 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-plugin,fastgpt-code-sandbox,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-plugin,fastgpt-code-sandbox,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-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
AGENT_SANDBOX_PROVIDER: opensandbox
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的 WebSocket 地址。
AGENT_SANDBOX_PROXY_URL: *x-agent-sandbox-proxy-url
# 浏览器访问 Sandbox 文件预览的 HTTP(S) 地址。
AGENT_SANDBOX_PREVIEW_PROXY_URL: *x-agent-sandbox-preview-proxy-url
# 沙盒规模大小
AGENT_SANDBOX_CPU_COUNT: 1
AGENT_SANDBOX_MEMORY_MIB: 2048
AGENT_SANDBOX_STORAGE_SIZE_GI: 1
# 不活跃判断阈值
AGENT_SANDBOX_SUSPEND_MINUTES: 60
# 长期不活跃判断阈值
AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS: 7
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# 自定义 npm/pip 源
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# Opensandox 配置
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE: ghcr.io/labring/fastgpt-agent-sandbox:v0.3.0-beta4
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX: fastgpt-session
# Sealos devbox 配置
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE:
# 向量库相关配置
x-vec-config: &x-vec-config
......@@ -170,7 +216,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.4
image: ghcr.io/labring/fastgpt:v4.16.0-beta1
ports:
- 3000:3000
networks:
......@@ -194,11 +240,11 @@ services:
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-share-db-config, *x-vec-config, *x-log-config, *x-no-proxy-config, *x-agent-sandbox-config]
HOSTNAME: 0.0.0.0
# ==================== 基础配置 ====================
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# root key(最高权限)
ROOT_KEY: *x-system-key
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
......@@ -229,11 +275,9 @@ services:
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
PASSWORD_LOGIN_MINUTE_LIMIT_COUNT:
# MCP Server 代理地址,用于 MCP 使用方式页拼接 SSE 地址
SSE_MCP_SERVER_PROXY_ENDPOINT:
# 官网访客归因 CRM;地址需包含 /api/v1,为空时不进行身份上报
CRM_API_URL:
CRM_API_KEY:
# ==================== 日志与监控 ====================
# 传递给 OTLP 收集器的服务名称
......@@ -266,7 +310,7 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.4
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.6
networks:
- codesandbox
restart: always
......@@ -330,7 +374,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.2
image: ghcr.io/labring/fastgpt-plugin:v1.1.0-beta1
container_name: fastgpt-plugin
restart: always
networks:
......@@ -356,6 +400,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: ghcr.io/labring/fastgpt-agent-volume-manager:v0.3.0-beta4
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: ghcr.io/labring/fastgpt-agent-sandbox:v0.3.0-beta4
profiles:
- prepull
opensandbox-execd-image:
image: opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.3.0-beta4
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
......@@ -429,6 +557,27 @@ volumes:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "opensandbox/execd:v1.0.21"
[egress]
image = "opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
init_sql:
name: init_sql
content: |
......
......@@ -5,12 +5,22 @@
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# Sandbox Proxy HTTP 预览地址,必须填写用户实际访问地址
x-agent-sandbox-preview-proxy-url: &x-agent-sandbox-preview-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt_plugin_auth_token_32char'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -39,8 +49,44 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-plugin,fastgpt-code-sandbox,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-plugin,fastgpt-code-sandbox,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-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
AGENT_SANDBOX_PROVIDER: opensandbox
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的 WebSocket 地址。
AGENT_SANDBOX_PROXY_URL: *x-agent-sandbox-proxy-url
# 浏览器访问 Sandbox 文件预览的 HTTP(S) 地址。
AGENT_SANDBOX_PREVIEW_PROXY_URL: *x-agent-sandbox-preview-proxy-url
# 沙盒规模大小
AGENT_SANDBOX_CPU_COUNT: 1
AGENT_SANDBOX_MEMORY_MIB: 2048
AGENT_SANDBOX_STORAGE_SIZE_GI: 1
# 不活跃判断阈值
AGENT_SANDBOX_SUSPEND_MINUTES: 60
# 长期不活跃判断阈值
AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS: 7
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# 自定义 npm/pip 源
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# Opensandox 配置
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE: ghcr.io/labring/fastgpt-agent-sandbox:v0.3.0-beta4
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX: fastgpt-session
# Sealos devbox 配置
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE:
# 向量库相关配置
x-vec-config: &x-vec-config
......@@ -154,7 +200,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.4
image: ghcr.io/labring/fastgpt:v4.16.0-beta1
ports:
- 3000:3000
networks:
......@@ -178,11 +224,11 @@ services:
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-share-db-config, *x-vec-config, *x-log-config, *x-no-proxy-config, *x-agent-sandbox-config]
HOSTNAME: 0.0.0.0
# ==================== 基础配置 ====================
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# root key(最高权限)
ROOT_KEY: *x-system-key
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
......@@ -213,11 +259,9 @@ services:
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
PASSWORD_LOGIN_MINUTE_LIMIT_COUNT:
# MCP Server 代理地址,用于 MCP 使用方式页拼接 SSE 地址
SSE_MCP_SERVER_PROXY_ENDPOINT:
# 官网访客归因 CRM;地址需包含 /api/v1,为空时不进行身份上报
CRM_API_URL:
CRM_API_KEY:
# ==================== 日志与监控 ====================
# 传递给 OTLP 收集器的服务名称
......@@ -250,7 +294,7 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.4
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.6
networks:
- codesandbox
restart: always
......@@ -314,7 +358,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.2
image: ghcr.io/labring/fastgpt-plugin:v1.1.0-beta1
container_name: fastgpt-plugin
restart: always
networks:
......@@ -340,6 +384,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: ghcr.io/labring/fastgpt-agent-volume-manager:v0.3.0-beta4
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: ghcr.io/labring/fastgpt-agent-sandbox:v0.3.0-beta4
profiles:
- prepull
opensandbox-execd-image:
image: opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.3.0-beta4
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
......@@ -411,3 +539,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "opensandbox/execd:v1.0.21"
[egress]
image = "opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
......@@ -5,12 +5,22 @@
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# Sandbox Proxy HTTP 预览地址,必须填写用户实际访问地址
x-agent-sandbox-preview-proxy-url: &x-agent-sandbox-preview-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt_plugin_auth_token_32char'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -39,8 +49,44 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-plugin,fastgpt-code-sandbox,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-plugin,fastgpt-code-sandbox,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-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
AGENT_SANDBOX_PROVIDER: opensandbox
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的 WebSocket 地址。
AGENT_SANDBOX_PROXY_URL: *x-agent-sandbox-proxy-url
# 浏览器访问 Sandbox 文件预览的 HTTP(S) 地址。
AGENT_SANDBOX_PREVIEW_PROXY_URL: *x-agent-sandbox-preview-proxy-url
# 沙盒规模大小
AGENT_SANDBOX_CPU_COUNT: 1
AGENT_SANDBOX_MEMORY_MIB: 2048
AGENT_SANDBOX_STORAGE_SIZE_GI: 1
# 不活跃判断阈值
AGENT_SANDBOX_SUSPEND_MINUTES: 60
# 长期不活跃判断阈值
AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS: 7
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# 自定义 npm/pip 源
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# Opensandox 配置
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE: ghcr.io/labring/fastgpt-agent-sandbox:v0.3.0-beta4
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX: fastgpt-session
# Sealos devbox 配置
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE:
# 向量库相关配置
x-vec-config: &x-vec-config
......@@ -152,7 +198,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.4
image: ghcr.io/labring/fastgpt:v4.16.0-beta1
ports:
- 3000:3000
networks:
......@@ -176,11 +222,11 @@ services:
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-share-db-config, *x-vec-config, *x-log-config, *x-no-proxy-config, *x-agent-sandbox-config]
HOSTNAME: 0.0.0.0
# ==================== 基础配置 ====================
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# root key(最高权限)
ROOT_KEY: *x-system-key
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
......@@ -211,11 +257,9 @@ services:
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
PASSWORD_LOGIN_MINUTE_LIMIT_COUNT:
# MCP Server 代理地址,用于 MCP 使用方式页拼接 SSE 地址
SSE_MCP_SERVER_PROXY_ENDPOINT:
# 官网访客归因 CRM;地址需包含 /api/v1,为空时不进行身份上报
CRM_API_URL:
CRM_API_KEY:
# ==================== 日志与监控 ====================
# 传递给 OTLP 收集器的服务名称
......@@ -248,7 +292,7 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.4
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.6
networks:
- codesandbox
restart: always
......@@ -312,7 +356,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.2
image: ghcr.io/labring/fastgpt-plugin:v1.1.0-beta1
container_name: fastgpt-plugin
restart: always
networks:
......@@ -338,6 +382,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: ghcr.io/labring/fastgpt-agent-volume-manager:v0.3.0-beta4
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: ghcr.io/labring/fastgpt-agent-sandbox:v0.3.0-beta4
profiles:
- prepull
opensandbox-execd-image:
image: opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.3.0-beta4
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
......@@ -409,3 +537,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "opensandbox/execd:v1.0.21"
[egress]
image = "opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
......@@ -5,12 +5,22 @@
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# Sandbox Proxy HTTP 预览地址,必须填写用户实际访问地址
x-agent-sandbox-preview-proxy-url: &x-agent-sandbox-preview-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt_plugin_auth_token_32char'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -39,8 +49,44 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-plugin,fastgpt-code-sandbox,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-plugin,fastgpt-code-sandbox,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-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
AGENT_SANDBOX_PROVIDER: opensandbox
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的 WebSocket 地址。
AGENT_SANDBOX_PROXY_URL: *x-agent-sandbox-proxy-url
# 浏览器访问 Sandbox 文件预览的 HTTP(S) 地址。
AGENT_SANDBOX_PREVIEW_PROXY_URL: *x-agent-sandbox-preview-proxy-url
# 沙盒规模大小
AGENT_SANDBOX_CPU_COUNT: 1
AGENT_SANDBOX_MEMORY_MIB: 2048
AGENT_SANDBOX_STORAGE_SIZE_GI: 1
# 不活跃判断阈值
AGENT_SANDBOX_SUSPEND_MINUTES: 60
# 长期不活跃判断阈值
AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS: 7
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# 自定义 npm/pip 源
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# Opensandox 配置
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE: ghcr.io/labring/fastgpt-agent-sandbox:v0.3.0-beta4
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX: fastgpt-session
# Sealos devbox 配置
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE:
# 向量库相关配置
x-vec-config: &x-vec-config
......@@ -157,7 +203,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.4
image: ghcr.io/labring/fastgpt:v4.16.0-beta1
ports:
- 3000:3000
networks:
......@@ -181,11 +227,11 @@ services:
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-share-db-config, *x-vec-config, *x-log-config, *x-no-proxy-config, *x-agent-sandbox-config]
HOSTNAME: 0.0.0.0
# ==================== 基础配置 ====================
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# root key(最高权限)
ROOT_KEY: *x-system-key
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
......@@ -216,11 +262,9 @@ services:
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
PASSWORD_LOGIN_MINUTE_LIMIT_COUNT:
# MCP Server 代理地址,用于 MCP 使用方式页拼接 SSE 地址
SSE_MCP_SERVER_PROXY_ENDPOINT:
# 官网访客归因 CRM;地址需包含 /api/v1,为空时不进行身份上报
CRM_API_URL:
CRM_API_KEY:
# ==================== 日志与监控 ====================
# 传递给 OTLP 收集器的服务名称
......@@ -253,7 +297,7 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.4
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.6
networks:
- codesandbox
restart: always
......@@ -317,7 +361,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.2
image: ghcr.io/labring/fastgpt-plugin:v1.1.0-beta1
container_name: fastgpt-plugin
restart: always
networks:
......@@ -343,6 +387,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: ghcr.io/labring/fastgpt-agent-volume-manager:v0.3.0-beta4
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: ghcr.io/labring/fastgpt-agent-sandbox:v0.3.0-beta4
profiles:
- prepull
opensandbox-execd-image:
image: opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.3.0-beta4
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
......@@ -414,3 +542,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "opensandbox/execd:v1.0.21"
[egress]
image = "opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
......@@ -5,12 +5,22 @@
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# Sandbox Proxy HTTP 预览地址,必须填写用户实际访问地址
x-agent-sandbox-preview-proxy-url: &x-agent-sandbox-preview-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
x-plugin-auth-token: &x-plugin-auth-token 'fastgpt_plugin_auth_token_32char'
# code sandbox token
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -39,8 +49,44 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 HTTP_PROXY/HTTPS_PROXY。
# 明确绕过 compose 内部服务,避免内部请求被代理劫持。
x-no-proxy-config: &x-no-proxy-config
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-plugin,fastgpt-code-sandbox,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-plugin,fastgpt-code-sandbox,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-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,fastgpt-aiproxy,fastgpt-aiproxy-pg,fastgpt-minio,fastgpt-mongo,fastgpt-redis,fastgpt-vector,fastgpt-mcp-server,host.docker.internal,*.orb.internal,*.orb.local
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
AGENT_SANDBOX_PROVIDER: opensandbox
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# 浏览器访问 agent-sandbox-proxy 的 WebSocket 地址。
AGENT_SANDBOX_PROXY_URL: *x-agent-sandbox-proxy-url
# 浏览器访问 Sandbox 文件预览的 HTTP(S) 地址。
AGENT_SANDBOX_PREVIEW_PROXY_URL: *x-agent-sandbox-preview-proxy-url
# 沙盒规模大小
AGENT_SANDBOX_CPU_COUNT: 1
AGENT_SANDBOX_MEMORY_MIB: 2048
AGENT_SANDBOX_STORAGE_SIZE_GI: 1
# 不活跃判断阈值
AGENT_SANDBOX_SUSPEND_MINUTES: 60
# 长期不活跃判断阈值
AGENT_SANDBOX_ARCHIVE_INACTIVE_DAYS: 7
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
# 自定义 npm/pip 源
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# Opensandox 配置
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE: ghcr.io/labring/fastgpt-agent-sandbox:v0.3.0-beta4
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: true
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX: fastgpt-session
# Sealos devbox 配置
AGENT_SANDBOX_SEALOS_BASEURL:
AGENT_SANDBOX_SEALOS_TOKEN:
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY: /home/devbox/workspace
AGENT_SANDBOX_SEALOS_IMAGE:
# 向量库相关配置
x-vec-config: &x-vec-config
......@@ -135,7 +181,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.4
image: ghcr.io/labring/fastgpt:v4.16.0-beta1
ports:
- 3000:3000
networks:
......@@ -157,11 +203,11 @@ services:
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-share-db-config, *x-vec-config, *x-log-config, *x-no-proxy-config, *x-agent-sandbox-config]
HOSTNAME: 0.0.0.0
# ==================== 基础配置 ====================
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# root key(最高权限)
ROOT_KEY: *x-system-key
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
......@@ -192,11 +238,9 @@ services:
AIPROXY_API_ENDPOINT: http://fastgpt-aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
PASSWORD_LOGIN_MINUTE_LIMIT_COUNT:
# MCP Server 代理地址,用于 MCP 使用方式页拼接 SSE 地址
SSE_MCP_SERVER_PROXY_ENDPOINT:
# 官网访客归因 CRM;地址需包含 /api/v1,为空时不进行身份上报
CRM_API_URL:
CRM_API_KEY:
# ==================== 日志与监控 ====================
# 传递给 OTLP 收集器的服务名称
......@@ -229,7 +273,7 @@ services:
TEXTIN_SECRET_CODE:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.4
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.6
networks:
- codesandbox
restart: always
......@@ -293,7 +337,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.2
image: ghcr.io/labring/fastgpt-plugin:v1.1.0-beta1
container_name: fastgpt-plugin
restart: always
networks:
......@@ -319,6 +363,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: ghcr.io/labring/fastgpt-agent-volume-manager:v0.3.0-beta4
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: ghcr.io/labring/fastgpt-agent-sandbox:v0.3.0-beta4
profiles:
- prepull
opensandbox-execd-image:
image: opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.3.0-beta4
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
......@@ -390,3 +518,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "opensandbox/execd:v1.0.21"
[egress]
image = "opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - Agent Sandbox Proxy 端口映射为 3006:1006
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# 文件阅读 token 密钥
......@@ -20,6 +24,8 @@ x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-token-please-change'
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -55,8 +61,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 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
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,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
......@@ -69,29 +75,25 @@ x-fastgpt-service-config: &x-fastgpt-service-config
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
# 默认启用 OpenSandbox;如使用其他 provider,请按沙盒配置文档替换相关变量。
AGENT_SANDBOX_PROVIDER: opensandbox
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_PROXY_URL: *x-agent-sandbox-proxy-url
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO:
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG:
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:
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_ENTRYPOINT_TIMEOUT_SECONDS: 30
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
......@@ -129,7 +131,7 @@ x-service-env-config: &x-service-env-config
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
AGENT_ENGINE: fastAgent
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 5
......@@ -165,10 +167,11 @@ x-service-env-config: &x-service-env-config
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
x-vec-config: &x-vec-config
MILVUS_ADDRESS: http://fastgpt-vector:19530
MILVUS_TOKEN: none
services:
fastgpt-milvus-minio:
container_name: fastgpt-milvus-minio
......@@ -326,7 +329,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.7
ports:
- 3000:3000
networks:
......@@ -362,12 +365,12 @@ services:
*x-app-env-config
]
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-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.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.7
networks:
- codesandbox
restart: always
......@@ -434,7 +437,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:v1.0.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.3
container_name: fastgpt-plugin
restart: always
networks:
......@@ -464,6 +467,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.2.0
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager:v0.2.0
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
profiles:
- prepull
opensandbox-execd-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
......@@ -535,3 +622,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21"
[egress]
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - Agent Sandbox Proxy 端口映射为 3006:1006
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# 文件阅读 token 密钥
......@@ -20,6 +24,8 @@ x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-token-please-change'
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -55,8 +61,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 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
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,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
......@@ -69,29 +75,25 @@ x-fastgpt-service-config: &x-fastgpt-service-config
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
# 默认启用 OpenSandbox;如使用其他 provider,请按沙盒配置文档替换相关变量。
AGENT_SANDBOX_PROVIDER: opensandbox
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_PROXY_URL: *x-agent-sandbox-proxy-url
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO:
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG:
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:
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_ENTRYPOINT_TIMEOUT_SECONDS: 30
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
......@@ -129,7 +131,7 @@ x-service-env-config: &x-service-env-config
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
AGENT_ENGINE: fastAgent
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 5
......@@ -165,9 +167,10 @@ x-service-env-config: &x-service-env-config
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
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
......@@ -304,7 +307,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.7
ports:
- 3000:3000
networks:
......@@ -340,12 +343,12 @@ services:
*x-app-env-config
]
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-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.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.7
networks:
- codesandbox
restart: always
......@@ -412,7 +415,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:v1.0.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.3
container_name: fastgpt-plugin
restart: always
networks:
......@@ -442,6 +445,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.2.0
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager:v0.2.0
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
profiles:
- prepull
opensandbox-execd-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
......@@ -515,6 +602,27 @@ volumes:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21"
[egress]
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
init_sql:
name: init_sql
content: |
......
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - Agent Sandbox Proxy 端口映射为 3006:1006
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# 文件阅读 token 密钥
......@@ -20,6 +24,8 @@ x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-token-please-change'
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -55,8 +61,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 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
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,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
......@@ -69,29 +75,25 @@ x-fastgpt-service-config: &x-fastgpt-service-config
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
# 默认启用 OpenSandbox;如使用其他 provider,请按沙盒配置文档替换相关变量。
AGENT_SANDBOX_PROVIDER: opensandbox
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_PROXY_URL: *x-agent-sandbox-proxy-url
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO:
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG:
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:
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_ENTRYPOINT_TIMEOUT_SECONDS: 30
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
......@@ -129,7 +131,7 @@ x-service-env-config: &x-service-env-config
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
AGENT_ENGINE: fastAgent
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 5
......@@ -165,9 +167,10 @@ x-service-env-config: &x-service-env-config
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
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
......@@ -288,7 +291,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.7
ports:
- 3000:3000
networks:
......@@ -324,12 +327,12 @@ services:
*x-app-env-config
]
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-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.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.7
networks:
- codesandbox
restart: always
......@@ -396,7 +399,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:v1.0.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.3
container_name: fastgpt-plugin
restart: always
networks:
......@@ -426,6 +429,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.2.0
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager:v0.2.0
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
profiles:
- prepull
opensandbox-execd-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
......@@ -497,3 +584,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21"
[egress]
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - Agent Sandbox Proxy 端口映射为 3006:1006
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# 文件阅读 token 密钥
......@@ -20,6 +24,8 @@ x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-token-please-change'
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -55,8 +61,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 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
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,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
......@@ -69,29 +75,25 @@ x-fastgpt-service-config: &x-fastgpt-service-config
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
# 默认启用 OpenSandbox;如使用其他 provider,请按沙盒配置文档替换相关变量。
AGENT_SANDBOX_PROVIDER: opensandbox
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_PROXY_URL: *x-agent-sandbox-proxy-url
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO:
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG:
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:
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_ENTRYPOINT_TIMEOUT_SECONDS: 30
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
......@@ -129,7 +131,7 @@ x-service-env-config: &x-service-env-config
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
AGENT_ENGINE: fastAgent
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 5
......@@ -165,9 +167,10 @@ x-service-env-config: &x-service-env-config
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
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
......@@ -286,7 +289,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.7
ports:
- 3000:3000
networks:
......@@ -322,12 +325,12 @@ services:
*x-app-env-config
]
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-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.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.7
networks:
- codesandbox
restart: always
......@@ -394,7 +397,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:v1.0.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.3
container_name: fastgpt-plugin
restart: always
networks:
......@@ -424,6 +427,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.2.0
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager:v0.2.0
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
profiles:
- prepull
opensandbox-execd-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
......@@ -495,3 +582,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21"
[egress]
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - Agent Sandbox Proxy 端口映射为 3006:1006
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# 文件阅读 token 密钥
......@@ -20,6 +24,8 @@ x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-token-please-change'
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -55,8 +61,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 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
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,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
......@@ -69,29 +75,25 @@ x-fastgpt-service-config: &x-fastgpt-service-config
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
# 默认启用 OpenSandbox;如使用其他 provider,请按沙盒配置文档替换相关变量。
AGENT_SANDBOX_PROVIDER: opensandbox
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_PROXY_URL: *x-agent-sandbox-proxy-url
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO:
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG:
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:
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_ENTRYPOINT_TIMEOUT_SECONDS: 30
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
......@@ -129,7 +131,7 @@ x-service-env-config: &x-service-env-config
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
AGENT_ENGINE: fastAgent
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 5
......@@ -165,9 +167,10 @@ x-service-env-config: &x-service-env-config
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
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
......@@ -291,7 +294,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.7
ports:
- 3000:3000
networks:
......@@ -327,12 +330,12 @@ services:
*x-app-env-config
]
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-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.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.7
networks:
- codesandbox
restart: always
......@@ -399,7 +402,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:v1.0.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.3
container_name: fastgpt-plugin
restart: always
networks:
......@@ -429,6 +432,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.2.0
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager:v0.2.0
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
profiles:
- prepull
opensandbox-execd-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
......@@ -500,3 +587,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21"
[egress]
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - Agent Sandbox Proxy 端口映射为 3006:1006
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# 文件阅读 token 密钥
......@@ -20,6 +24,8 @@ x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-token-please-change'
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -55,8 +61,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 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
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,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
......@@ -69,29 +75,25 @@ x-fastgpt-service-config: &x-fastgpt-service-config
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
# 默认启用 OpenSandbox;如使用其他 provider,请按沙盒配置文档替换相关变量。
AGENT_SANDBOX_PROVIDER: opensandbox
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_PROXY_URL: *x-agent-sandbox-proxy-url
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO:
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG:
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:
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_ENTRYPOINT_TIMEOUT_SECONDS: 30
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
......@@ -129,7 +131,7 @@ x-service-env-config: &x-service-env-config
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
AGENT_ENGINE: fastAgent
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 5
......@@ -165,10 +167,11 @@ x-service-env-config: &x-service-env-config
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
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
......@@ -269,7 +272,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.15.7
ports:
- 3000:3000
networks:
......@@ -303,12 +306,12 @@ services:
*x-app-env-config
]
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-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.4
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-code-sandbox:v4.15.7
networks:
- codesandbox
restart: always
......@@ -375,7 +378,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:v1.0.2
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v1.0.3
container_name: fastgpt-plugin
restart: always
networks:
......@@ -405,6 +408,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.2.0
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager:v0.2.0
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
profiles:
- prepull
opensandbox-execd-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.6.5
......@@ -476,3 +563,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21"
[egress]
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - Agent Sandbox Proxy 端口映射为 3006:1006
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# 文件阅读 token 密钥
......@@ -20,6 +24,8 @@ x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-token-please-change'
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -55,8 +61,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 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
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,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
......@@ -69,29 +75,25 @@ x-fastgpt-service-config: &x-fastgpt-service-config
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
# 默认启用 OpenSandbox;如使用其他 provider,请按沙盒配置文档替换相关变量。
AGENT_SANDBOX_PROVIDER: opensandbox
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_PROXY_URL: *x-agent-sandbox-proxy-url
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO:
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG:
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:
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_ENTRYPOINT_TIMEOUT_SECONDS: 30
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
......@@ -129,7 +131,7 @@ x-service-env-config: &x-service-env-config
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
AGENT_ENGINE: fastAgent
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 5
......@@ -165,10 +167,11 @@ x-service-env-config: &x-service-env-config
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
x-vec-config: &x-vec-config
MILVUS_ADDRESS: http://fastgpt-vector:19530
MILVUS_TOKEN: none
services:
fastgpt-milvus-minio:
container_name: fastgpt-milvus-minio
......@@ -326,7 +329,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.4
image: ghcr.io/labring/fastgpt:v4.15.7
ports:
- 3000:3000
networks:
......@@ -362,12 +365,12 @@ services:
*x-app-env-config
]
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.4
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.7
networks:
- codesandbox
restart: always
......@@ -434,7 +437,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.2
image: ghcr.io/labring/fastgpt-plugin:v1.0.3
container_name: fastgpt-plugin
restart: always
networks:
......@@ -464,6 +467,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: opensandbox/server:v0.2.0
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: ghcr.io/labring/fastgpt-agent-volume-manager:v0.2.0
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0
profiles:
- prepull
opensandbox-execd-image:
image: opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
......@@ -535,3 +622,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "opensandbox/execd:v1.0.21"
[egress]
image = "opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - Agent Sandbox Proxy 端口映射为 3006:1006
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# 文件阅读 token 密钥
......@@ -20,6 +24,8 @@ x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-token-please-change'
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -55,8 +61,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 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
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,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
......@@ -69,29 +75,25 @@ x-fastgpt-service-config: &x-fastgpt-service-config
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
# 默认启用 OpenSandbox;如使用其他 provider,请按沙盒配置文档替换相关变量。
AGENT_SANDBOX_PROVIDER: opensandbox
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_PROXY_URL: *x-agent-sandbox-proxy-url
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO:
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG:
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:
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_ENTRYPOINT_TIMEOUT_SECONDS: 30
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
......@@ -129,7 +131,7 @@ x-service-env-config: &x-service-env-config
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
AGENT_ENGINE: fastAgent
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 5
......@@ -165,9 +167,10 @@ x-service-env-config: &x-service-env-config
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
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
......@@ -304,7 +307,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.4
image: ghcr.io/labring/fastgpt:v4.15.7
ports:
- 3000:3000
networks:
......@@ -340,12 +343,12 @@ services:
*x-app-env-config
]
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.4
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.7
networks:
- codesandbox
restart: always
......@@ -412,7 +415,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.2
image: ghcr.io/labring/fastgpt-plugin:v1.0.3
container_name: fastgpt-plugin
restart: always
networks:
......@@ -442,6 +445,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: opensandbox/server:v0.2.0
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: ghcr.io/labring/fastgpt-agent-volume-manager:v0.2.0
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0
profiles:
- prepull
opensandbox-execd-image:
image: opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
......@@ -515,6 +602,27 @@ volumes:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "opensandbox/execd:v1.0.21"
[egress]
image = "opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
init_sql:
name: init_sql
content: |
......
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - Agent Sandbox Proxy 端口映射为 3006:1006
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# 文件阅读 token 密钥
......@@ -20,6 +24,8 @@ x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-token-please-change'
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -55,8 +61,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 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
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,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
......@@ -69,29 +75,25 @@ x-fastgpt-service-config: &x-fastgpt-service-config
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
# 默认启用 OpenSandbox;如使用其他 provider,请按沙盒配置文档替换相关变量。
AGENT_SANDBOX_PROVIDER: opensandbox
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_PROXY_URL: *x-agent-sandbox-proxy-url
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO:
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG:
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:
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_ENTRYPOINT_TIMEOUT_SECONDS: 30
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
......@@ -129,7 +131,7 @@ x-service-env-config: &x-service-env-config
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
AGENT_ENGINE: fastAgent
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 5
......@@ -165,9 +167,10 @@ x-service-env-config: &x-service-env-config
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
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
......@@ -288,7 +291,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.4
image: ghcr.io/labring/fastgpt:v4.15.7
ports:
- 3000:3000
networks:
......@@ -324,12 +327,12 @@ services:
*x-app-env-config
]
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.4
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.7
networks:
- codesandbox
restart: always
......@@ -396,7 +399,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.2
image: ghcr.io/labring/fastgpt-plugin:v1.0.3
container_name: fastgpt-plugin
restart: always
networks:
......@@ -426,6 +429,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: opensandbox/server:v0.2.0
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: ghcr.io/labring/fastgpt-agent-volume-manager:v0.2.0
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0
profiles:
- prepull
opensandbox-execd-image:
image: opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
......@@ -497,3 +584,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "opensandbox/execd:v1.0.21"
[egress]
image = "opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - Agent Sandbox Proxy 端口映射为 3006:1006
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# 文件阅读 token 密钥
......@@ -20,6 +24,8 @@ x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-token-please-change'
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -55,8 +61,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 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
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,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
......@@ -69,29 +75,25 @@ x-fastgpt-service-config: &x-fastgpt-service-config
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
# 默认启用 OpenSandbox;如使用其他 provider,请按沙盒配置文档替换相关变量。
AGENT_SANDBOX_PROVIDER: opensandbox
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_PROXY_URL: *x-agent-sandbox-proxy-url
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO:
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG:
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:
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_ENTRYPOINT_TIMEOUT_SECONDS: 30
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
......@@ -129,7 +131,7 @@ x-service-env-config: &x-service-env-config
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
AGENT_ENGINE: fastAgent
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 5
......@@ -165,9 +167,10 @@ x-service-env-config: &x-service-env-config
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
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
......@@ -286,7 +289,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.4
image: ghcr.io/labring/fastgpt:v4.15.7
ports:
- 3000:3000
networks:
......@@ -322,12 +325,12 @@ services:
*x-app-env-config
]
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.4
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.7
networks:
- codesandbox
restart: always
......@@ -394,7 +397,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.2
image: ghcr.io/labring/fastgpt-plugin:v1.0.3
container_name: fastgpt-plugin
restart: always
networks:
......@@ -424,6 +427,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: opensandbox/server:v0.2.0
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: ghcr.io/labring/fastgpt-agent-volume-manager:v0.2.0
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0
profiles:
- prepull
opensandbox-execd-image:
image: opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
......@@ -495,3 +582,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "opensandbox/execd:v1.0.21"
[egress]
image = "opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - Agent Sandbox Proxy 端口映射为 3006:1006
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# 文件阅读 token 密钥
......@@ -20,6 +24,8 @@ x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-token-please-change'
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -55,8 +61,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 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
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,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
......@@ -69,29 +75,25 @@ x-fastgpt-service-config: &x-fastgpt-service-config
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
# 默认启用 OpenSandbox;如使用其他 provider,请按沙盒配置文档替换相关变量。
AGENT_SANDBOX_PROVIDER: opensandbox
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_PROXY_URL: *x-agent-sandbox-proxy-url
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO:
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG:
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:
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_ENTRYPOINT_TIMEOUT_SECONDS: 30
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
......@@ -129,7 +131,7 @@ x-service-env-config: &x-service-env-config
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
AGENT_ENGINE: fastAgent
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 5
......@@ -165,9 +167,10 @@ x-service-env-config: &x-service-env-config
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
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
......@@ -291,7 +294,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.4
image: ghcr.io/labring/fastgpt:v4.15.7
ports:
- 3000:3000
networks:
......@@ -327,12 +330,12 @@ services:
*x-app-env-config
]
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.4
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.7
networks:
- codesandbox
restart: always
......@@ -399,7 +402,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.2
image: ghcr.io/labring/fastgpt-plugin:v1.0.3
container_name: fastgpt-plugin
restart: always
networks:
......@@ -429,6 +432,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: opensandbox/server:v0.2.0
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: ghcr.io/labring/fastgpt-agent-volume-manager:v0.2.0
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0
profiles:
- prepull
opensandbox-execd-image:
image: opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
......@@ -500,3 +587,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "opensandbox/execd:v1.0.21"
[egress]
image = "opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3003:3000
# - 如需启用 Agent/Skill 沙盒,请单独部署 fastgpt-agent-sandbox-proxy
# - Agent Sandbox Proxy 端口映射为 3006:1006
# - 建议修改账密后再运行
# root 默认密码(重启后会强制重置该密码成环境变量值)
x-default-root-psw: &x-default-root-psw '1234'
# FastGPT 前端访问地址,必须填写用户实际访问 FastGPT 的地址
x-fe-domain: &x-fe-domain ''
# Sandbox Proxy WebSocket 地址,必须填写用户实际访问地址
x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url ''
# 系统最高密钥凭证
x-system-key: &x-system-key 'fastgpt-xxx'
# 文件阅读 token 密钥
......@@ -20,6 +24,8 @@ x-plugin-auth-token: &x-plugin-auth-token 'fastgpt-plugin-token-please-change'
x-code-sandbox-token: &x-code-sandbox-token 'codesandbox'
# agent sandbox proxy secret,必须与 FastGPT 主站环境变量保持一致,且至少 32 位
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret 'default_fastgpt_agent_sandbox_proxy_secret'
# volume manager token,必须与 FastGPT 主站环境变量保持一致
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
......@@ -55,8 +61,8 @@ x-log-config: &x-log-config
# 容器运行环境可能会自动注入 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
NO_PROXY: localhost,127.0.0.1,::1,fastgpt-app,fastgpt-plugin,fastgpt-code-sandbox,fastgpt-agent-sandbox-proxy,fastgpt-opensandbox-server,fastgpt-volume-manager,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-opensandbox-server,fastgpt-volume-manager,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
......@@ -69,29 +75,25 @@ x-fastgpt-service-config: &x-fastgpt-service-config
# FastGPT 主服务的 Agent Sandbox 配置
x-agent-sandbox-config: &x-agent-sandbox-config
# v4.15.0 默认不绑定具体 Agent Sandbox provider。
# 如需启用 Agent/Skill 沙盒,请参考升级文档选择 sealosdevbox 或 opensandbox 后补充对应环境变量。
AGENT_SANDBOX_PROVIDER:
# 默认启用 OpenSandbox;如使用其他 provider,请按沙盒配置文档替换相关变量。
AGENT_SANDBOX_PROVIDER: opensandbox
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_PROXY_URL: *x-agent-sandbox-proxy-url
AGENT_SANDBOX_OPENSANDBOX_BASEURL: http://fastgpt-opensandbox-server:8090
AGENT_SANDBOX_OPENSANDBOX_API_KEY: fastgpt-opensandbox-api-key
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: docker
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO:
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG:
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:
AGENT_SANDBOX_ENABLE_VOLUME: false
AGENT_SANDBOX_VOLUME_MANAGER_URL:
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN:
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL: http://fastgpt-volume-manager:3000
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN: *x-volume-manager-auth-token
AGENT_SANDBOX_DISK_MB: 1024
AGENT_SANDBOX_MAX_EDIT_DEBUG: 100
AGENT_SANDBOX_ENTRYPOINT_TIMEOUT_SECONDS: 30
AGENT_SANDBOX_WS_MAX_MESSAGE_BYTES: 67108864
AGENT_SANDBOX_WS_MAX_FRAME_BYTES: 16777216
AGENT_SANDBOX_NPM_REGISTRY:
AGENT_SANDBOX_PYPI_INDEX_URL:
# FastGPT App 专用环境变量(projects/app/src/env.ts · appEnv)
x-app-env-config: &x-app-env-config
......@@ -129,7 +131,7 @@ x-service-env-config: &x-service-env-config
PASSWORD_LOGIN_LOCK_SECONDS:
MAX_LOGIN_SESSION:
ALLOWED_ORIGINS:
AGENT_ENGINE: default
AGENT_ENGINE: fastAgent
SKIP_FILE_TYPE_CHECK: false
WECHAT_CHANNEL_CONCURRENCY: 1000
PARSE_FILE_WORKERS: 5
......@@ -165,10 +167,11 @@ x-service-env-config: &x-service-env-config
WORKFLOW_HTTP_IGNORE_HTTPS_CERT: false
# 向量库相关配置
x-vec-config: &x-vec-config
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
......@@ -269,7 +272,7 @@ services:
fastgpt-app:
container_name: fastgpt-app
image: ghcr.io/labring/fastgpt:v4.15.4
image: ghcr.io/labring/fastgpt:v4.15.7
ports:
- 3000:3000
networks:
......@@ -303,12 +306,12 @@ services:
*x-app-env-config
]
# 必填。客户端访问 FastGPT 时使用的地址,由协议、主机和可选端口组成,用于补全文件资源路径。例如 https://fastgpt.cn;本地开发可使用 http://localhost:3000。
FE_DOMAIN:
FE_DOMAIN: *x-fe-domain
# 文件域名(也指向 FastGPT 服务);如需更高安全性可独立分配域名,避免高危文件读取到主域名内容
FILE_DOMAIN:
fastgpt-code-sandbox:
container_name: fastgpt-code-sandbox
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.4
image: ghcr.io/labring/fastgpt-code-sandbox:v4.15.7
networks:
- codesandbox
restart: always
......@@ -375,7 +378,7 @@ services:
<<: [*x-log-config, *x-no-proxy-config]
FASTGPT_ENDPOINT: http://fastgpt-app:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v1.0.2
image: ghcr.io/labring/fastgpt-plugin:v1.0.3
container_name: fastgpt-plugin
restart: always
networks:
......@@ -405,6 +408,90 @@ services:
timeout: 20s
retries: 3
# OpenSandbox Server 和 Volume Manager 仅需在 app 内网中访问。
fastgpt-opensandbox-server:
image: opensandbox/server:v0.2.0
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: ghcr.io/labring/fastgpt-agent-volume-manager:v0.2.0
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# 仅用于预拉取运行时镜像,不会随 docker compose up 启动。
opensandbox-agent-sandbox-image:
image: ghcr.io/labring/fastgpt-agent-sandbox:v0.2.0
profiles:
- prepull
opensandbox-execd-image:
image: opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: opensandbox/egress:v1.1.4
profiles:
- prepull
# 浏览器访问 Agent Sandbox 的鉴权代理,生产环境应通过独立域名反向代理 3006 端口。
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
<<: [*x-no-proxy-config]
PORT: 1006
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
# AI Proxy
fastgpt-aiproxy:
image: ghcr.io/labring/aiproxy:v0.6.5
......@@ -476,3 +563,26 @@ volumes:
fastgpt-seekdb-data:
fastgpt-seekdb-config:
fastgpt-aiproxy_pg:
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "opensandbox/execd:v1.0.21"
[egress]
image = "opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
......@@ -153,6 +153,155 @@ validate_config_file() {
fi
}
validate_fe_domain() {
local value="$1"
if [[ ! "$value" =~ ^https?://[^[:space:]]+$ ]]; then
echo "错误: FE_DOMAIN 必须是以 http:// 或 https:// 开头的完整地址" >&2
return 1
fi
}
validate_sandbox_preview_proxy_url() {
local value="$1"
if [[ ! "$value" =~ ^https?://[^[:space:]]+$ ]]; then
echo "错误: FASTGPT_SANDBOX_PREVIEW_PROXY_URL 必须是以 http:// 或 https:// 开头的完整地址" >&2
return 1
fi
}
validate_sandbox_proxy_url() {
local value="$1"
if [[ ! "$value" =~ ^wss?://[^[:space:]]+$ ]]; then
echo "错误: FASTGPT_SANDBOX_PROXY_URL 必须是以 ws:// 或 wss:// 开头的完整地址" >&2
return 1
fi
}
request_fe_domain() {
local input
if [ -n "$FASTGPT_FE_DOMAIN" ]; then
input="$FASTGPT_FE_DOMAIN"
elif [ "$NON_INTERACTIVE" = true ]; then
echo "错误: 非交互模式必须设置 FASTGPT_FE_DOMAIN,例如 https://fastgpt.example.com" >&2
exit 1
else
while true; do
read -r -p "请输入 FastGPT 访问地址 (如 http://localhost:3000): " input
if validate_fe_domain "$input"; then
break
fi
done
fi
validate_fe_domain "$input" || exit 1
FE_DOMAIN_INPUT="$input"
}
request_sandbox_proxy_url() {
local input
if [ -n "$FASTGPT_SANDBOX_PROXY_URL" ]; then
input="$FASTGPT_SANDBOX_PROXY_URL"
elif [ "$NON_INTERACTIVE" = true ]; then
echo "错误: 非交互模式必须设置 FASTGPT_SANDBOX_PROXY_URL,例如 wss://sandbox-proxy.example.com" >&2
exit 1
else
while true; do
read -r -p "请输入 Sandbox-proxy 访问地址 (ws 地址,如 ws://localhost:3006): " input
if validate_sandbox_proxy_url "$input"; then
break
fi
done
fi
validate_sandbox_proxy_url "$input" || exit 1
SANDBOX_PROXY_URL_INPUT="${input%/}"
}
is_v415_deploy() {
[ "$DEPLOY_VERSION" = "v4.15" ] ||
{ [ "$DEPLOY_VERSION" = "$LOCAL_DEPLOY_VERSION" ] && grep -q 'fastgpt:v4\.15' "$LOCAL_COMPOSE_PATH" 2>/dev/null; }
}
request_sandbox_preview_proxy_url() {
local input
if [ -n "$FASTGPT_SANDBOX_PREVIEW_PROXY_URL" ]; then
input="$FASTGPT_SANDBOX_PREVIEW_PROXY_URL"
elif is_v415_deploy; then
if [[ "$SANDBOX_PROXY_URL_INPUT" == wss://* ]]; then
input="https://${SANDBOX_PROXY_URL_INPUT#wss://}"
else
input="http://${SANDBOX_PROXY_URL_INPUT#ws://}"
fi
elif [ "$NON_INTERACTIVE" = true ]; then
echo "错误: 非交互模式必须设置 FASTGPT_SANDBOX_PREVIEW_PROXY_URL,例如 http://localhost:3006" >&2
exit 1
else
while true; do
read -r -p "请输入 Sandbox-proxy 访问地址 (http 地址,如 http://localhost:3006): " input
if validate_sandbox_preview_proxy_url "$input"; then
break
fi
done
fi
validate_sandbox_preview_proxy_url "$input" || exit 1
SANDBOX_PREVIEW_PROXY_URL_INPUT="${input%/}"
}
configure_fe_domain() {
local input escaped_domain
input="$FE_DOMAIN_INPUT"
if [ -z "$input" ]; then
request_fe_domain
input="$FE_DOMAIN_INPUT"
fi
escaped_domain="$(escape_sed_replacement "$input")"
if LC_ALL=C grep -qE "^x-fe-domain: &x-fe-domain" docker-compose.yml; then
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s|^x-fe-domain: &x-fe-domain.*|x-fe-domain: \\&x-fe-domain '$escaped_domain'|g" docker-compose.yml
else
sed -i "s|^x-fe-domain: &x-fe-domain.*|x-fe-domain: \\&x-fe-domain '$escaped_domain'|g" docker-compose.yml
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s|^\([[:space:]]*FE_DOMAIN:\).*|\1 $escaped_domain|g" docker-compose.yml
else
sed -i "s|^\([[:space:]]*FE_DOMAIN:\).*|\1 $escaped_domain|g" docker-compose.yml
fi
echo "已更新 FastGPT 访问地址为: $input"
}
configure_sandbox_proxy_urls() {
local preview_url="$SANDBOX_PREVIEW_PROXY_URL_INPUT"
local proxy_url="$SANDBOX_PROXY_URL_INPUT"
local escaped_preview escaped_proxy
escaped_preview="$(escape_sed_replacement "$preview_url")"
escaped_proxy="$(escape_sed_replacement "$proxy_url")"
if LC_ALL=C grep -qE '^x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url' docker-compose.yml; then
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s|^x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url.*|x-agent-sandbox-proxy-url: \\&x-agent-sandbox-proxy-url '$escaped_proxy'|g" docker-compose.yml
sed -i '' "s|^x-agent-sandbox-preview-proxy-url: &x-agent-sandbox-preview-proxy-url.*|x-agent-sandbox-preview-proxy-url: \\&x-agent-sandbox-preview-proxy-url '$escaped_preview'|g" docker-compose.yml
else
sed -i "s|^x-agent-sandbox-proxy-url: &x-agent-sandbox-proxy-url.*|x-agent-sandbox-proxy-url: \\&x-agent-sandbox-proxy-url '$escaped_proxy'|g" docker-compose.yml
sed -i "s|^x-agent-sandbox-preview-proxy-url: &x-agent-sandbox-preview-proxy-url.*|x-agent-sandbox-preview-proxy-url: \\&x-agent-sandbox-preview-proxy-url '$escaped_preview'|g" docker-compose.yml
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s|^\([[:space:]]*AGENT_SANDBOX_PREVIEW_PROXY_URL:\).*|\1 $escaped_preview|g" docker-compose.yml
sed -i '' "s|^\([[:space:]]*AGENT_SANDBOX_PROXY_URL:\).*|\1 $escaped_proxy|g" docker-compose.yml
else
sed -i "s|^\([[:space:]]*AGENT_SANDBOX_PREVIEW_PROXY_URL:\).*|\1 $escaped_preview|g" docker-compose.yml
sed -i "s|^\([[:space:]]*AGENT_SANDBOX_PROXY_URL:\).*|\1 $escaped_proxy|g" docker-compose.yml
fi
if [ -n "$preview_url" ]; then
echo "已更新 Sandbox 预览地址为: $preview_url"
fi
}
resolve_input_path() {
local input="$1"
......@@ -217,6 +366,13 @@ normalize_bool_env() {
fi
}
normalize_deploy_base_url() {
local url="$1"
url="${url%/}"
url="${url%/deploy}"
printf '%s/deploy\n' "$url"
}
ROOT_LOGIN_PASSWORD="1234"
randomize_compose_credentials() {
......@@ -264,6 +420,7 @@ randomize_compose_credentials() {
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 'fastgpt_plugin_auth_token_32char'" "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\""
......@@ -337,6 +494,13 @@ if [ -n "$FASTGPT_NON_INTERACTIVE" ]; then
NON_INTERACTIVE="$(normalize_bool_env FASTGPT_NON_INTERACTIVE "$FASTGPT_NON_INTERACTIVE")"
fi
# 可选:指定部署文件下载源的站点地址,例如 https://doc.example.com 或
# https://doc.example.com/deploy。适用于文档站使用自定义域名、内网镜像或本地调试。
CUSTOM_DEPLOY_BASE_URL=""
if [ -n "$FASTGPT_DEPLOY_BASE_URL" ]; then
CUSTOM_DEPLOY_BASE_URL="$(normalize_deploy_base_url "$FASTGPT_DEPLOY_BASE_URL")"
fi
# 获取部署版本展示文案:main 为迭代版,其他版本均视为稳定版
get_version_label() {
local version="$1"
......@@ -403,11 +567,11 @@ if [ "$DEPLOY_VERSION" != "$LOCAL_DEPLOY_VERSION" ]; then
case "$FASTGPT_REGION" in
cn | CN | china | China)
REGION="cn"
BASE_URL="https://doc.fastgpt.cn/deploy"
BASE_URL="${CUSTOM_DEPLOY_BASE_URL:-https://doc.fastgpt.cn/deploy}"
;;
global | GLOBAL | Global | github | GitHub)
REGION="global"
BASE_URL="https://doc.fastgpt.io/deploy"
BASE_URL="${CUSTOM_DEPLOY_BASE_URL:-https://doc.fastgpt.io/deploy}"
;;
*)
echo "错误: 不支持的 FASTGPT_REGION: $FASTGPT_REGION"
......@@ -417,17 +581,17 @@ if [ "$DEPLOY_VERSION" != "$LOCAL_DEPLOY_VERSION" ]; then
esac
elif [ "$NON_INTERACTIVE" = true ]; then
REGION="cn"
BASE_URL="https://doc.fastgpt.cn/deploy"
BASE_URL="${CUSTOM_DEPLOY_BASE_URL:-https://doc.fastgpt.cn/deploy}"
else
radio_select "请选择镜像源 (↑↓ 选择, 回车确认):" "阿里云 (中国大陆)" "GitHub (全球)"
case $RADIO_RESULT in
1)
REGION="global"
BASE_URL="https://doc.fastgpt.io/deploy"
BASE_URL="${CUSTOM_DEPLOY_BASE_URL:-https://doc.fastgpt.io/deploy}"
;;
*)
REGION="cn"
BASE_URL="https://doc.fastgpt.cn/deploy"
BASE_URL="${CUSTOM_DEPLOY_BASE_URL:-https://doc.fastgpt.cn/deploy}"
;;
esac
fi
......@@ -606,6 +770,17 @@ select_address "请选择 SSE MCP 访问地址 - 客户端和容器均需可访
MCP_ADDR="$SELECTED_ADDR"
MCP_CUSTOM=$SELECTED_CUSTOM
# ========== 8. 输入 FastGPT 访问地址 ==========
request_fe_domain
# ========== 9. 输入 Sandbox Proxy 地址 ==========
request_sandbox_proxy_url
# ========== 10. 输入 Sandbox 预览地址 ==========
if ! is_v415_deploy; then
request_sandbox_preview_proxy_url
fi
# ========== 确认配置 ==========
DEPLOY_VERSION_LABEL="$(get_version_label "$DEPLOY_VERSION")"
......@@ -653,8 +828,17 @@ if [ "$NEEDS_S3_EXTERNAL_ENDPOINT" = true ]; then
echo " S3 地址: $S3_DISPLAY"
fi
echo " MCP 地址: $MCP_DISPLAY"
echo " FastGPT 地址: $FE_DOMAIN_INPUT"
echo " Sandbox WebSocket 地址: $SANDBOX_PROXY_URL_INPUT"
if ! is_v415_deploy; then
echo " Sandbox 预览地址: $SANDBOX_PREVIEW_PROXY_URL_INPUT"
fi
echo " 密钥处理: $CREDENTIALS_LABEL"
echo "=============================="
echo "请确认域名或反向代理已指向对应端口:FastGPT -> 3000,Sandbox Proxy -> 3006,MCP -> 3003。"
if [ "$NEEDS_S3_EXTERNAL_ENDPOINT" = true ]; then
echo "S3 地址需指向 9000 端口。"
fi
echo ""
if [ "$NON_INTERACTIVE" = true ]; then
echo "非交互模式已自动确认配置"
......@@ -707,6 +891,10 @@ else
echo "已下载 docker-compose.yml"
fi
# ========== 配置 FastGPT 访问地址 ==========
configure_fe_domain
configure_sandbox_proxy_urls
USES_CONFIG_JSON=false
if LC_ALL=C grep -q -- "./config.json:/app/data/config.json" docker-compose.yml; then
USES_CONFIG_JSON=true
......@@ -725,7 +913,8 @@ if LC_ALL=C grep -q -- "./config.json:/app/data/config.json" docker-compose.yml;
mv "$CONFIG_FILE" config.json
echo "已复制 config.json"
else
CONFIG_URL="https://doc.fastgpt.cn/deploy/config/config.json"
CONFIG_BASE_URL="${BASE_URL:-${CUSTOM_DEPLOY_BASE_URL:-https://doc.fastgpt.cn/deploy}}"
CONFIG_URL="${CONFIG_BASE_URL}/config/config.json"
curl -fsSL "$CONFIG_URL" -o "$CONFIG_FILE"
if [ $? -ne 0 ]; then
echo "错误: 下载 config.json 失败: $CONFIG_URL"
......@@ -925,26 +1114,27 @@ else
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 " 1. 预拉取镜像: docker compose --profile prepull pull"
echo " 2. 启动服务: docker compose up -d"
if [ "$NEEDS_S3_EXTERNAL_ENDPOINT" = true ]; then
echo " 3. 开放端口: 3000, 9000, 3003"
echo " 3. 开放端口: 3000, 9000, 3003, 3006"
else
echo " 3. 开放端口: 3000, 3003"
echo " 3. 开放端口: 3000, 3003, 3006"
fi
echo " 4. 访问服务: http://localhost:3000"
echo " 5. 登录服务: 默认账号为 'root', 密码为: '$ROOT_LOGIN_PASSWORD'"
echo " 6. 配置模型: 在 '账号-模型提供商' 页面,进行模型配置"
else
echo " 1. 启动服务: docker compose up -d"
echo " 1. 预拉取镜像: docker compose pull"
echo " 2. 启动服务: docker compose up -d"
if [ "$NEEDS_S3_EXTERNAL_ENDPOINT" = true ]; then
echo " 2. 开放端口: 3000, 9000, 3003"
echo " 3. 开放端口: 3000, 9000, 3003"
else
echo " 2. 开放端口: 3000, 3003"
echo " 3. 开放端口: 3000, 3003"
fi
echo " 3. 访问服务: http://localhost:3000"
echo " 4. 登录服务: 默认账号为 'root', 密码为: '$ROOT_LOGIN_PASSWORD'"
echo " 5. 配置模型: 在 '账号-模型提供商' 页面,进行模型配置"
echo " 4. 访问服务: http://localhost:3000"
echo " 5. 登录服务: 默认账号为 'root', 密码为: '$ROOT_LOGIN_PASSWORD'"
echo " 6. 配置模型: 在 '账号-模型提供商' 页面,进行模型配置"
fi
echo ""
echo "详细文档: https://doc.fastgpt.cn/self-host/deploy/docker"
# FastGPT Agent Sandbox Proxy standalone deployment.
# After starting this file, set FastGPT AGENT_SANDBOX_PROXY_URL to ws://<host>:3006 or your wss:// domain,
# and set AGENT_SANDBOX_PREVIEW_PROXY_URL to http://<host>:3006 or your https:// domain.
x-agent-sandbox-proxy-secret: &x-agent-sandbox-proxy-secret "default_fastgpt_agent_sandbox_proxy_secret"
services:
fastgpt-agent-sandbox-proxy:
image: ghcr.io/labring/fastgpt-agent-sandbox-proxy:v0.2.0
container_name: fastgpt-agent-sandbox-proxy
restart: always
networks:
- app
ports:
- 3006:1006
environment:
PORT: 1006
# Must exactly match AGENT_SANDBOX_PROXY_SECRET in fastgpt-app / fastgpt-pro.
AGENT_SANDBOX_PROXY_SECRET: *x-agent-sandbox-proxy-secret
# FastGPT main service URL reachable from this container.
# If this compose file joins the FastGPT app network, you can use http://fastgpt-app:3000.
FASTGPT_APP_URL: http://fastgpt-app:3000
FASTGPT_APP_REQUEST_TIMEOUT_SECS: 60
RUST_LOG: info,fastgpt_agent_sandbox_proxy=debug
networks:
app:
# OpenSandbox standalone deployment for FastGPT Agent/Skill Sandbox.
# Deploy fastgpt-agent-sandbox-proxy separately, then set FastGPT.
#
# If these services are copied into the same docker-compose.yml as FastGPT:
# AGENT_SANDBOX_PROVIDER=opensandbox
# AGENT_SANDBOX_OPENSANDBOX_BASEURL=http://fastgpt-opensandbox-server:8090
# AGENT_SANDBOX_OPENSANDBOX_API_KEY=fastgpt-opensandbox-api-key
# AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URL=http://fastgpt-volume-manager:3000
# AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN=vmtoken
# AGENT_SANDBOX_OPENSANDBOX_VOLUME_NAME_PREFIX=fastgpt-session
x-volume-manager-auth-token: &x-volume-manager-auth-token "vmtoken"
x-no-proxy-config: &x-no-proxy-config
# Avoid inherited proxy settings. Some Docker runtimes inject IPv6 CIDR into NO_PROXY,
# and httpx may parse it as an invalid URL port during OpenSandbox startup.
NO_PROXY: localhost,127.0.0.1,127.0.0.0/8,host.docker.internal,host.orb.internal,docker.orb.internal,*.orb.internal,*.orb.local,proxyproxy.orb.internal,gateway.orb.internal,fastgpt-opensandbox-server,fastgpt-volume-manager,fastgpt-app
no_proxy: localhost,127.0.0.1,127.0.0.0/8,host.docker.internal,host.orb.internal,docker.orb.internal,*.orb.internal,*.orb.local,proxyproxy.orb.internal,gateway.orb.internal,fastgpt-opensandbox-server,fastgpt-volume-manager,fastgpt-app
services:
fastgpt-opensandbox-server:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:v0.2.1
container_name: fastgpt-opensandbox-server
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
<<: [*x-no-proxy-config]
SANDBOX_CONFIG_PATH: /etc/opensandbox/config.toml
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8090/health',timeout=3).status==200 else 1)"
]
interval: 10s
timeout: 5s
retries: 5
fastgpt-volume-manager:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-volume-manager:v0.2.0
container_name: fastgpt-volume-manager
restart: always
networks:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
<<: [*x-no-proxy-config]
PORT: 3000
VM_RUNTIME: docker
VM_AUTH_TOKEN: *x-volume-manager-auth-token
VM_LOG_LEVEL: info
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
]
interval: 10s
timeout: 5s
retries: 5
# Pre-pull only: not started by `docker compose up` (uses profile `prepull`).
opensandbox-agent-sandbox-image:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-agent-sandbox:v0.2.0
profiles:
- prepull
opensandbox-execd-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21
profiles:
- prepull
opensandbox-egress-image:
image: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4
profiles:
- prepull
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
api_key = "fastgpt-opensandbox-api-key"
log_level = "INFO"
[runtime]
type = "docker"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.21"
[egress]
image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.1.4"
[docker]
network_mode = "bridge"
# When server runs in a container, set host_ip to the host's IP or hostname so bridge-mode endpoints are reachable.
host_ip = "host.docker.internal"
[ingress]
mode = "direct"
networks:
app:
Subproject commit 18869dd92cd3f0559918e9234f39e415114ae402
Subproject commit a72dbb1b3614fbb57cbe2e9765a92c6a4ad2b16e
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