Ragflow服务器上部署教程
参考官方文档进行整理
克隆相应代码
git clone https://github.com/infiniflow/ragflow.git
修改vm.max_map_count
sudo sysctl -w vm.max_map_count=262144
修改 daemon.json文件
{"registry-mirrors": ["https://docker.m.daocloud.io","https://0dj0t5fb.mirror.aliyuncs.com","https://docker.mirrors.ustc.edu.cn","https://6kx4zyno.mirror.aliyuncs.com","https://registry.docker-cn.com","https://docker.registry.cyou","https://docker-cf.registry.cyou","https://dockercf.jsdelivr.fyi","https://docker.jsdelivr.fyi","https://dockertest.jsdelivr.fyi","https://mirror.aliyuncs.com","https://dockerproxy.com","https://mirror.baidubce.com","https://docker.nju.edu.cn","https://docker.mirrors.sjtug.sjtu.edu.cn","https://mirror.iscas.ac.cn","https://docker.rainbond.cc","https://do.nark.eu.org","https://dc.j8.work","https://gst6rzl9.mirror.aliyuncs.com","http://hub-mirror.c.163.com","http://mirrors.ustc.edu.cn/","https://mirrors.tuna.tsinghua.edu.cn/","http://mirrors.sohu.com/"],"insecure-registries": ["registry.docker-cn.com","docker.mirrors.ustc.edu.cn"],"debug": true,"experimental": false,"runtimes": {"nvidia": {"args": [],"path": "nvidia-container-runtime"}}
}
重新加载
sudo systemctl daemon-reload
sudo systemctl enable docker
进入Docker目录进行相应修改
修改.env文件
首先修改镜像的内容,我们这里修改为v0.18.0
RAGFLOW_IMAGE=swr.cn-north-4.myhuaweicloud.com/infiniflow/ragflow:v0.17.2
可选修改:
如果服务器有配置Dify,.env文件的REDIS_PORT也需要修改
修改.yml文件
我们这里修改的是docker-compose-gpu.yml这一个文件
主要修改端口的相关映射
# The RAGFlow team do not actively maintain docker-compose-gpu.yml, so use them at your own risk.
# Pull requests to improve it are welcome.
include:- ./docker-compose-base.ymlservices:ragflow:depends_on:mysql:condition: service_healthyimage: ${RAGFLOW_IMAGE}container_name: ragflow-serverports:- ${SVR_HTTP_PORT}:9380- 80:80 **主要修改这里,比如用8080去映射80,修改前面的80即可,用4443去映射443**- 443:443 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.confenv_file: .envenvironment:- TZ=${TIMEZONE}- HF_ENDPOINT=${HF_ENDPOINT}- MACOS=${MACOS}networks:- ragflowrestart: on-failure# https://docs.docker.com/engine/daemon/prometheus/#create-a-prometheus-configuration# If you're using Docker Desktop, the --add-host flag is optional. This flag makes sure that the host's internal IP gets exposed to the Prometheus container.extra_hosts:- "host.docker.internal:host-gateway"deploy:resources:reservations:devices:- driver: nvidiacount: all #多卡部署的情况,这里也需要修改设为1或者0capabilities: [gpu]
服务器启动
docker logs -f ragflow-server
控制台出现相关日志,无报错,通过http://ip地址即可进行访问,出现以下地址即说明成功