1

先来看看官方文档 https://ragflow.io/docs/v0.16.0/,那是相当简单

1. 下载

git clone https://github.com/infiniflow/ragflow.git
cd ragflow
git checkout -f v0.16.0

2.启动

docker-compose -f docker/docker-compose.yml up -d

啊,报错了

no matching manifest for linux/arm64/v8 in the manifest list entries

想着可能因为我们是 M4,换一个文件

docker-compose -f docker/docker-compose-macos.yml up -d

仍然报错

=> ERROR [ragflow internal] load metadata for docker.io/infiniflow/ragflow_deps:latest
.........
failed to solve: infiniflow/ragflow_deps:latest: failed to resolve source metadata for docker.io/infiniflow/ragflow_deps:latest: no match for platform in manifest: not found

原来并没有想象的这么简单,不碰钉子就没有必要写博客了,想要体验大模型总要有点门槛的嘛,

这是为什么呢

IMPORTANT
We officially support x86 CPU and Nvidia GPU, and this document offers instructions on deploying RAGFlow using Docker on x86 platforms. While we also test RAGFlow on ARM64 platforms, we do not maintain RAGFlow Docker images for ARM.
If you are on an ARM platform, follow this guide to build a RAGFlow Docker image.

哦,原来是官方竟然偷懒了。。

人工构建

参见文档https://ragflow.io/docs/dev/build_docker_image

有两种情况,1. 不需要内置向量模型 2. 需要向量模型

不需要向量模型的

准备工作,找到 Dockfile,改一下 NEED_MIRROR,懂的都懂,不另外解释

ARG NEED_MIRROR=1 # 改成1,走国内镜像

只需要构建一个镜像

docker build --build-arg LIGHTEN=1 -f Dockerfile -t infiniflow/ragflow:v0.16.0-slim .

注:镜像名跟官网稍微不一样,主要是为了跟 .env 的配置匹配

创建日志目录,下面启动服务用的到。不然会无权限报错

sudo mkdir -p docker/ragflow-logs
sudo chmod -R 777 docker/ragflow-logs

改一下 .env 环境变量,因为用 Mac,这里也改一下,去掉前面的注释

# Optimizations for MacOS
# Uncomment the following line if your OS is MacOS:
MACOS=1

好了,docker-compose 就可以启动了

docker-compose -f docker/docker-compose.yml up -d

看一下访问地址

docker logs -f ragflow-server

--------------- 下面是补充 ---------------------

需要内嵌向量模型的

先安装下依赖(跟文档里稍微有点不样,文档用的 uv 命令,我不知道 uv 是啥命令,所以替代一下)

pip3 install huggingface_hub nltk
python3 download_deps.py

接下来生成镜像

docker build -f Dockerfile.deps -t infiniflow/ragflow_deps .

docker build -f Dockerfile -t infiniflow/ragflow:v0.16.0 .

因为内嵌向量模型,所以这里也换了一下

# The RAGFlow Docker image to download.
# Defaults to the v0.16.0-slim edition, which is the RAGFlow Docker image without embedding models.
# RAGFLOW_IMAGE=infiniflow/ragflow:v0.16.0-slim
#
# To download the RAGFlow Docker image with embedding models, uncomment the following line instead:
RAGFLOW_IMAGE=infiniflow/ragflow:v0.16.0

乌啦啦
1.3k 声望31 粉丝

沉淀,沉淀,沉淀