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

相关推荐
AI大模型19 小时前
基于 Ollama 本地 LLM 大语言模型实现 ChatGPT AI 聊天系统
程序员·llm·ollama
李大腾腾3 天前
3、JSON处理( n8n 节点用于交换信息的语言)
openai·workflow·ollama
陈佬昔没带相机3 天前
ollama 终于有UI了,但我却想弃坑了
人工智能·llm·ollama
李大腾腾4 天前
2、n8n 构建你的第一个 AI Agent
openai·agent·ollama
一包烟电脑面前做一天6 天前
RAG实现:.Net + Ollama + Qdrant 实现文本向量化,实现简单RAG
.net·向量数据库·ai大模型·rag·ollama·qdrant·文本分块
一包烟电脑面前做一天6 天前
MCP实现:.Net实现MCP服务端 + Ollama ,MCP服务端工具调用
.net·ai大模型·ollama·mcp·mcp服务端
简放8 天前
智能机票助手-接入Ollama本地模型-Spring-AI-Alibaba
spring boot·langchain·ollama
高克莱9 天前
【macOS操作系统部署开源DeepSeek大模型,搭建Agent平台,构建私有化RAG知识库完整流程】
macos·llm·agent·知识库·anythingllm·ollama·deepseek
GitLqr14 天前
AI洞察 | Manus 与 GPT-5 等最新动向
chatgpt·claude·ollama
大模型教程17 天前
大模型本地部署:手把手带你在Mac本地部署运行AI大模型
程序员·llm·ollama