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: 关联不太大,确实有点智障,当然可能和配置的大模型有关系,后续继续学习吧

相关推荐
陈佬昔没带相机15 小时前
Dify MCP功能实测,小参数模型竟然全军覆没!
ollama·deepseek·mcp
会写代码的斯皮尔伯格2 天前
Spring Boot 3整合Spring AI实战:9轮面试对话解析AI应用开发
openai·微服务架构·java面试·rag·ollama·spring ai·spring boot 3
萌主墩墩3 天前
趣玩-Ollama-Llm-Chatrbot
llm·qwen·ollama·deepseek
AI大模型4 天前
五分钟搭建属于你的AI助手:Ollama+DeepSeek+AnythingLLM深度整合
llm·ollama·deepseek
Hi202402178 天前
macOS 12.7.6部署Ollama+Dify避坑指南
macos·知识库·dify·ollama
Blessed_Li10 天前
Linux系统安装部署GraphRAG完全指南
llm·rag·ollama·graphrag
胡耀超13 天前
GraphRAG Docker化部署,接入本地Ollama完整技术指南:从零基础到生产部署的系统性知识体系
运维·docker·容器·大模型·知识图谱·rag·ollama
会飞的果粒橙22 天前
在Ubuntu24上安装ollama
ollama·deepseek
ZHOU_WUYI1 个月前
Ragflow 源码:ragflow_server.py
ragflow