FastGPT 是 labring 开源的基于 LLM 的 RAG 知识库问答与 AI 工作流编排平台,主项目为 Next.js + TypeScript Monorepo(pnpm workspace)。本镜像在 OpenCloudOS 9 上从源码构建 projects/app(Next.js standalone 输出),运行依赖 MongoDB、PostgreSQL+pgvector 等外部服务(生产环境通过 docker-compose 编排)。
# 默认按宿主机架构构建(推荐)
docker build -t oc9-fastgpt:4.14.9.5 .
# 显式指定目标架构(适用于跨架构构建)
docker buildx build --platform linux/amd64 -t oc9-fastgpt:4.14.9.5 . --load
docker buildx build --platform linux/arm64 -t oc9-fastgpt:4.14.9.5-arm64 . --load
提示:FastGPT 是 monorepo 项目,构建过程包含
pnpm install和pnpm --filter=app build,国内网络下首次构建预计 15-30 分钟,最终镜像体积较大(GB 级)。
# 1. 验证镜像可启动 + 检查 Next.js standalone 产物存在
bash test.sh oc9-fastgpt:4.14.9.5
# 2. 完整运行(需自备 MongoDB + PostgreSQL+pgvector)
docker run -d --name fastgpt -p 3000:3000 \
-e MONGODB_URI="mongodb://<user>:<pass>@<host>:27017/fastgpt?authSource=admin" \
-e PG_URL="postgresql://<user>:<pass>@<host>:5432/postgres" \
-e CHAT_API_KEY="<your-key>" \
-v $(pwd)/config.json:/app/data/config.json \
oc9-fastgpt:4.14.9.5
更完整的部署方式(含 MongoDB / PG / MinIO / Redis 编排)参见 FastGPT 官方文档:https://doc.fastgpt.cn/docs/development/docker/
镜像已在以下两种架构验证通过:
| 架构 | 操作系统 | 内核 | Docker | 状态 |
|---|---|---|---|---|
| x86_64 (amd64) | Ubuntu 22.04.4 LTS (Jammy) | 5.15.0-113-generic | 29.4.1 | ✓ 通过 |
| arm64 (aarch64) | macOS (Apple Silicon) | Darwin 25.x | Docker Desktop | ✓ 通过(开发自测) |
构建时 Dockerfile 通过 BuildKit 注入的 TARGETARCH 自动选择对应的 Node.js 二进制(linux-x64 / linux-arm64),同一份 Dockerfile 可在两种架构原生构建。
test.sh 仅做启动产物校验,不做完整服务可用性测试。--platform=linux/amd64 构建会走 qemu 模拟,速度慢且偶现兼容性问题;本机原生 linux/arm64 构建可正常完成,CI 仍以 linux/amd64 为准。Content type
Image
Digest
sha256:adac2e8c1…
Size
1.7 GB
Last updated
4 months ago
docker pull ocpub/oc9-fastgpt:4.14.9.5