Docker 运行RAGFlow 搭建RAG知识库

借鉴视频:DeepSeek 10分钟完全本地部署 保姆级教程 断网运行 无惧隐私威胁 大语言模型 CPU GPU 混合推理32B轻松本地部署!DeepSeek模拟王者!!_哔哩哔哩_bilibili

借鉴博客:RAGFlow搭建全攻略:从入门到精通,轻松构建RAG知识库-CSDN博客

环境要求:RAGFlow 运行内存需要 > 8G,硬盘需要 > 20G,CPU 内核 > 4

运行性能展示:

本地部署的环境: ollama 部署在 window 本地, RAGFlow 部署在虚拟机 Redhat 环境

Linux 系统安装 Docker

本地虚拟机 Redhat 9.0系统

复制代码
# 编辑 docker源
cd /etc/yum.repos.d/
vim docker-ce.repo
# 输入下面信息
[docker]
 name=docker
 baseurl=https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/rhel/9/x86_64/stable/
 gpgcheck=0 
dnf makecache

# 安装docker
dnf search docker
dnf install docker-ce.x86_64
  
# 卸载 podman 冲突
rpm -qa |grep podman
rpm -e podman-docker-4.2.0-3.el9.noarch --nodeps
rpm -qa |grep runc
rpm -e runc-1.1.4-1.el9.x86_64 --nodeps

启动:
systemctl enable --now docker
systemctl start docker

# 运行docker
[root@AI docker]# docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
e6590344b1a5: Pull complete
Digest: sha256:940c619fbd418f9b2b1b63e25d8861f9cc1b46e3fc8b018ccfe8b78f19b8cc4f
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest

安装中遇到的问题:

问题1:

root@AI yum.repos.d# docker pull hello-world

Using default tag: latest

Cannot connect to the Docker daemon at unix:///run/podman/podman.sock. Is the docker daemon running?

添加权限, 然后 reboot

sudo usermod -aG docker ${USER}

问题2:

docker pull hello-world

Using default tag: latest

Error response from daemon: Get "https://registry-1.docker.io/v2/": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

vim /etc/docker/daemon.json

添加下面信息

{

"registry-mirrors" : [

"https://docker.nju.edu.cn",

"https://docker.mirrors.sjtug.sjtu.edu.cn"

],

"insecure-registries" : [

"docker.mirrors.ustc.edu.cn"

],

"debug": true,

"experimental": false

}

重启服务

sudo systemctl restart docker

搭建RAGFlow 环境:

复制代码
# 克隆代码库
git clone https://github.com/infiniflow/ragflow.git

# 修改.env文件, 使用完整版
# 第84行:# RAGFLOW_IMAGE=infiniflow/ragflow:v0.16.0-slim
# 第87行:RAGFLOW_IMAGE=infiniflow/ragflow:v0.16.0

cd ragflow/docker
# 启动服务
docker compose -f docker-compose.yml up -d

# 查看运行状态
docker logs -f ragflow-server

遇到的问题:

安装成功效果展示

运行完成:

查看运行日志:

访问目标环境地址:

注册登录即可

登录页面选择 ollama 模型

选择 chat 类型,模型名称输入已部署 ollama名称及地址

查看另一台环境部署的 ollama:

复制代码
# 查看模型名称
ollama list
NAME                 ID              SIZE      MODIFIED
deepseek8b:latest    07c360b6bd34    4.9 GB    18 hours ago

# 容许访问,以windows 为例
window:  [Environment]::SetEnvironmentVariable("OLLAMA_HOST", "0.0.0.0", "Machine")
关闭防火墙端口 New-NetFirewallRule -DisplayName "Ollama API" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 11434

(确认后运行时间稍长,需要等待 10分钟... )

Embedding 模型用于知识库的向量转换

创建知识库

编写配置.

上传测试知识库文件,本地上传的华为交换机命令文档

效果展示:

创建聊天:

运行结果确认:

PS: 关联不太大,确实有点智障,当然可能和配置的大模型有关系,后续继续学习吧

相关推荐
xifangge202515 小时前
用 Ollama 本地部署 Codex + 接入 DeepSeek-R1 零成本避坑指南(附桥接配置)
ai编程·codex·ollama·deepseek
福大大架构师每日一题3 天前
RAGFlow v0.25.0:全新发布,覆盖解析管道、数据源、Agent、语言界面、模型支持与安全修复的全面升级
ragflow
Koma-forever5 天前
OpenClaw-使用本地Ollamam模型(opencalw config+ ollama launch)
ollama·openclaw
2301_767113987 天前
Ollama 本地部署与运维使用指南
人工智能·ollama
leonshi9 天前
使用embedchain快速建立rag知识库,本地大模型
ai·rag·ollama
匹诺曹i36711 天前
memory_search 对了、7B 总结错了:OpenClaw D4 来源引用与 8 个坑
ollama
匹诺曹i36713 天前
docx 报表进 OpenClaw 本地 RAG:memory 索引实践与 6 个坑
ollama
福大大架构师每日一题25 天前
ollama v0.30.8 最新更新解读:修复启动提供方选择错误,提示词缓存更稳,MLX 推理与递归模型全面增强
ollama
大佐不会说日语~1 个月前
在 Windows 本地用 Docker 部署向量模型(bge-m3)
windows·docker·容器·llm·ollama
腾飞开源1 个月前
05_Dify接入Ollama本地大模型
人工智能·项目实战·dify·ai智能体·ollama·企业级应用·接入模型