Docker 安装 RAGFlow保姆教程

前提条件

  1. Ubuntu 服务器(20.04 或 22.04 LTS 推荐)
  2. 已安装 DockerDocker Compose
    • 如果尚未安装,请先运行以下命令:
      # 安装 Docker
      curl -fsSL https://get.docker.com -o get-docker.sh
      sudo sh get-docker.sh
      # 将当前用户加入 docker 组,避免每次都要 sudo
      sudo usermod -aG docker $USER
      newgrp docker # 刷新组权限,或重新登录服务器生效
      
      # 安装 Docker Compose 插件
      sudo apt-get update
      sudo apt-get install docker-compose-plugin
      # 验证安装
      docker compose version
      
  3. 确保服务器端口 808010 未被其他程序占用。RAGFlow 默认使用这些端口。

安装步骤

第 1 步:下载部署文件

首先,创建一个项目目录并进入,然后从 GitHub 拉取 RAGFlow 的 Docker Compose 配置文件。

# 创建并进入一个目录,例如 ragflow
mkdir ragflow && cd ragflow

# 从 GitHub 拉取 RAGFlow 的 Docker Compose 配置文件
git clone https://github.com/infiniflow/ragflow.git
第 2 步:修改RAGFlow配置

RAGFlow依赖组件包括Mysql、Redis、MinIO、Nginx等,因为我的服务之前已安装过这些组件,防止端口冲突,影响RAGFlow启动。

  • 修改docker-compose.yml中nginx的端口从80修改成8580,443修改成8443

注意:原则不在配置这个 docker-compose.yml直接修改端口号,正确的做法应该是修改环境变量

include:
  - ./docker-compose-base.yml
# To ensure that the container processes the locally modified `service_conf.yaml.template` instead of the one included in its image, you need to mount the local `service_conf.yaml.template` to the container.
services:
  ragflow:
    depends_on:
      mysql:
        condition: service_healthy
    image: ${
   
   RAGFLOW_IMAGE}
    # Example configuration to set up an MCP server:
    # command:
    #   - --enable-mcpserver
    #   - --mcp-host=0.0.0.0
    #   - --mcp-port=9382
    #   - --mcp-base-url=http://127.0.0.1:9380
    #   - --mcp-script-path=/ragflow/mcp/server/server.py
    #   - --mcp-mode=self-host
    #   - --mcp-host-api-key=ragflow-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    # Optional transport flags for MCP (customize if needed).
    # Host mode need to combined with --no-transport-streamable-http-enabled flag, namely, host+streamable-http is not supported yet.
    # The following are enabled by default unless explicitly disabled with --no-<flag>.
    #   - --no-transport-sse-enabled # Disable legacy SSE endpoints (/sse and /messages/)
    #   - --no-transport-streamable-http-enabled #  Disable Streamable HTTP transport (/mcp endpoint)
    #   - --no-json-response # Disable JSON response mode in Streamable HTTP transport (instead of SSE over HTTP)
    container_name: ragflow-server
    ports:
      - ${
   
   SVR_HTTP_PORT}:9380
      - 8580:80  #修改1
      - 8443:443 #修改2
      - 5678:5678 
      - 5679:5679
      - 9382:9382 # entry for MCP (host_port:docker_port). The docker_port must match the value you set for `mcp-port` above.
    volumes:
      - ./ragflow-logs:/ragflow/logs
      - ./nginx/ragflow.conf:/etc/nginx/conf.d/ragflow.conf
      - ./nginx/proxy.conf:/etc/nginx/proxy.conf
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
      - ../history_data_agent:/ragflow/history_data_agent
      - ./service_conf.yaml.template:/ragflow/conf/service_conf.yaml.template
      - ./entrypoint.sh:/ragflow/entrypoint.sh
    env_file: .env
    environment:
      - TZ=${
   
   TIMEZONE}
      - HF_ENDPOINT=$
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值