本地部署 RAGFlow - 修改默认端口

本地部署 RAGFlow - 修改默认端口

    • [1. 前提条件](#1. 前提条件)
    • [2. 部署 RAGFlow](#2. 部署 RAGFlow)

1. 前提条件

确保 vm.max_map_count 不小于 262144:

如需确认 vm.max_map_count 的大小:

复制代码
sysctl vm.max_map_count

如果 vm.max_map_count 的值小于 262144,可以进行重置:

复制代码
# 这里我们设为 262144:
sudo sysctl -w vm.max_map_count=262144

你的改动会在下次系统重启时被重置。如果希望做永久改动,还需要在 /etc/sysctl.conf 文件里把 vm.max_map_count 的值再相应更新一遍:

复制代码
vm.max_map_count=262144

2. 部署 RAGFlow

克隆仓库:

复制代码
git clone https://github.com/infiniflow/ragflow.git
cd ragflow/docker

修改默认端口(为了不与Dify和Langfush冲突)和默认镜像地址(解决国内网络访问Docker镜像网站问题),这里使用git diff命令显示修改的地方。

复制代码
git diff docker/.env

diff --git a/docker/.env b/docker/.env
index 2b0b5b8b..db206212 100644
--- a/docker/.env
+++ b/docker/.env
@@ -40,7 +40,7 @@ INFINITY_HOST=infinity
 # Port to expose Infinity API to the host
 INFINITY_THRIFT_PORT=23817
 INFINITY_HTTP_PORT=23820
-INFINITY_PSQL_PORT=5432
+INFINITY_PSQL_PORT=5434

 # The password for MySQL.
 MYSQL_PASSWORD=infini_rag_flow
@@ -53,13 +53,13 @@ MYSQL_DBNAME=rag_flow
 MYSQL_PORT=5455

 # The hostname where the MinIO service is exposed
-MINIO_HOST=minio
+MINIO_HOST=minio_ragflow
 # The port used to expose the MinIO console interface to the host machine,
 # allowing EXTERNAL access to the web-based console running inside the Docker container.
-MINIO_CONSOLE_PORT=9001
+MINIO_CONSOLE_PORT=9003
 # The port used to expose the MinIO API service to the host machine,
 # allowing EXTERNAL access to the MinIO object storage service running inside the Docker container.
-MINIO_PORT=9000
+MINIO_PORT=9019
 # The username for MinIO.
 # When updated, you must revise the `minio.user` entry in service_conf.yaml accordingly.
 MINIO_USER=rag_flow
@@ -68,10 +68,10 @@ MINIO_USER=rag_flow
 MINIO_PASSWORD=infini_rag_flow

 # The hostname where the Redis service is exposed
-REDIS_HOST=redis
+REDIS_HOST=redis_ragflow
 # The port used to expose the Redis service to the host machine,
 # allowing EXTERNAL access to the Redis service running inside the Docker container.
-REDIS_PORT=6379
+REDIS_PORT=6381
 # The password for Redis.
 REDIS_PASSWORD=infini_rag_flow

git diff docker/docker-compose.yml

diff --git a/docker/.env b/docker/.env
index 2b0b5b8b..db206212 100644
--- a/docker/.env
+++ b/docker/.env
@@ -40,7 +40,7 @@ INFINITY_HOST=infinity
 # Port to expose Infinity API to the host
 INFINITY_THRIFT_PORT=23817
 INFINITY_HTTP_PORT=23820
-INFINITY_PSQL_PORT=5432
+INFINITY_PSQL_PORT=5434

 # The password for MySQL.
 MYSQL_PASSWORD=infini_rag_flow
@@ -53,13 +53,13 @@ MYSQL_DBNAME=rag_flow
 MYSQL_PORT=5455

 # The hostname where the MinIO service is exposed
-MINIO_HOST=minio
+MINIO_HOST=minio_ragflow
 # The port used to expose the MinIO console interface to the host machine,
 # allowing EXTERNAL access to the web-based console running inside the Docker container.
-MINIO_CONSOLE_PORT=9001
+MINIO_CONSOLE_PORT=9003
 # The port used to expose the MinIO API service to the host machine,
 # allowing EXTERNAL access to the MinIO object storage service running inside the Docker container.
-MINIO_PORT=9000
+MINIO_PORT=9019
 # The username for MinIO.
 # When updated, you must revise the `minio.user` entry in service_conf.yaml accordingly.
 MINIO_USER=rag_flow
@@ -68,10 +68,10 @@ MINIO_USER=rag_flow
 MINIO_PASSWORD=infini_rag_flow

 # The hostname where the Redis service is exposed
-REDIS_HOST=redis
+REDIS_HOST=redis_ragflow
 # The port used to expose the Redis service to the host machine,
 # allowing EXTERNAL access to the Redis service running inside the Docker container.
-REDIS_PORT=6379
+REDIS_PORT=6381
 # The password for Redis.
 REDIS_PASSWORD=infini_rag_flow

(base) root@DESKTOP-31CKLQ1:/u01/workspace/ragflow-main/docker# git diff docker-compose.yml
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index 676f167d..e7036643 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -6,12 +6,12 @@ services:
     depends_on:
       mysql:
         condition: service_healthy
-    image: ${RAGFLOW_IMAGE}
+    image: docker.1ms.run/${RAGFLOW_IMAGE}
     container_name: ragflow-server
     ports:
       - ${SVR_HTTP_PORT}:9380
-      - 80:80
-      - 443:443
+      - 50080:80
+      - 50443:443
     volumes:
       - ./ragflow-logs:/ragflow/logs
       - ./nginx/ragflow.conf:/etc/nginx/conf.d/ragflow.conf

git diff docker/docker-compose-base.yml

diff --git a/docker/docker-compose-base.yml b/docker/docker-compose-base.yml
index 93804d5a..abf7e9e4 100644
--- a/docker/docker-compose-base.yml
+++ b/docker/docker-compose-base.yml
@@ -3,7 +3,7 @@ services:
     container_name: ragflow-es-01
     profiles:
       - elasticsearch
-    image: elasticsearch:${STACK_VERSION}
+    image: docker.1ms.run/elasticsearch:${STACK_VERSION}
     volumes:
       - esdata01:/usr/share/elasticsearch/data
     ports:
@@ -39,7 +39,7 @@ services:
     container_name: ragflow-infinity
     profiles:
       - infinity
-    image: infiniflow/infinity:v0.6.0-dev3
+    image: docker.1ms.run/infiniflow/infinity:v0.6.0-dev3
     volumes:
       - infinity_data:/var/infinity
       - ./infinity_conf.toml:/infinity_conf.toml
@@ -68,7 +68,7 @@ services:

   mysql:
     # mysql:5.7 linux/arm64 image is unavailable.
-    image: mysql:8.0.39
+    image: docker.1ms.run/mysql:8.0.39
     container_name: ragflow-mysql
     env_file: .env
     environment:
@@ -95,8 +95,8 @@ services:
       retries: 3
     restart: on-failure

-  minio:
-    image: quay.io/minio/minio:RELEASE.2023-12-20T01-00-02Z
+  minio_ragflow:
+    image: docker.1ms.run/minio/minio:RELEASE.2023-12-20T01-00-02Z
     container_name: ragflow-minio
     command: server --console-address ":9001" /data
     ports:
@@ -108,21 +108,21 @@ services:
       - MINIO_ROOT_PASSWORD=${MINIO_PASSWORD}
       - TZ=${TIMEZONE}
     volumes:
-      - minio_data:/data
+      - minio_ragflow_data:/data
     networks:
       - ragflow
     restart: on-failure

-  redis:
+  redis_ragflow:
     # swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/valkey/valkey:8
-    image: valkey/valkey:8
+    image: docker.1ms.run/valkey/valkey:8
     container_name: ragflow-redis
     command: redis-server --requirepass ${REDIS_PASSWORD} --maxmemory 128mb --maxmemory-policy allkeys-lru
     env_file: .env
     ports:
       - ${REDIS_PORT}:6379
     volumes:
-      - redis_data:/data
+      - redis_ragflow_data:/data
     networks:
       - ragflow
     restart: on-failure
@@ -136,9 +136,9 @@ volumes:
     driver: local
   mysql_data:
     driver: local
-  minio_data:
+  minio_ragflow_data:
     driver: local
-  redis_data:
+  redis_ragflow_data:
     driver: local

启动,

复制代码
docker compose -p ragflow -f docker-compose.yml up -d

一定要指定 -p ragflow,否则和Dify项目冲突,因为他们的docker-compose.yml文件都在docker目录下面。

打开 http://ip:50080 进行访问。

完结!

相关推荐
Mininglamp_27186 天前
Mano-P 低配部署:多模型并行的实际配置清单
ai·本地部署·mano-p
奈落2416 天前
AI辅助的另一面:从2026年国际AI安全报告的“故障”清单到国内专家的可靠性短板,自主行动的Agent为什么更难及时干预
人工智能·安全·agent·本地部署·ai 办公
OxYGC18 天前
智能体项目复盘 · deepagents 篇:1 主 3 子架构、HITL、RAGFlow 接入,以及 16 个真实踩坑
多智能体·智能体·ragflow·deepagents
一枕槐安48718 天前
开源大模型 Llama3 本地部署全过程,Ollama 上手
开源·本地部署·大模型推理·ollama·llama3·modelfile
合尘猫20 天前
6GB 笔记本本地跑 Z-Image Turbo:一次从 cu121 到 cu130 的踩坑记录
人工智能·ai·大模型·本地部署
奈落2422 天前
RAG 上线只是起点:知识库漂移、模型退化、依赖网扩张,生产环境的长期维护难题怎么拆
本地部署·ai 编程
84869811925 天前
RAGFlow v1.0 企业级 RAG 落地实录:从零部署到 RAGAS 评估闭环(全踩坑记录)
人工智能·大模型·rag·ragflow·ragas
爱上纯净的蓝天1 个月前
不用云做 RAG:一个本地笔记问答工具的取舍与坑
python·开源·大模型·rag·本地部署
张张123y1 个月前
120B 模型单卡跑起来?拆解 Nemotron 3.5 的压缩三板斧与本地智能体部署
nvidia·模型量化·本地部署·ai agent·nemotron
Web3&Basketball1 个月前
Meta Muse 816B 实测:两台 Mac 本地跑通
macos·大模型·mac·本地部署·moe·显存优化·meta muse