Mac M芯片 RAG 极简流程 安装 ragflow + LM studio
本文基于 【【知识科普】【纯本地化搭建】【不本地也行】DeepSeek + RAGFlow 构建个人知识库】 https://www.bilibili.com/video/BV1WiP2ezE5a/?share_source=copy_web&vd_source=9a55f12dd64d8e30ab6c0efc62844343
1 .docker-compose yml文件修改,指定平台 platform: linux/amd64
services:es01:container_name: ragflow-es-01profiles:- elasticsearchimage: elasticsearch:${STACK_VERSION}volumes:- esdata01:/usr/share/elasticsearch/dataports:- ${ES_PORT}:9200env_file: .envenvironment:- node.name=es01- ELASTIC_PASSWORD=${ELASTIC_PASSWORD}- bootstrap.memory_lock=false- discovery.type=single-node- xpack.security.enabled=true- xpack.security.http.ssl.enabled=false- xpack.security.transport.ssl.enabled=false- cluster.routing.allocation.disk.watermark.low=5gb- cluster.routing.allocation.disk.watermark.high=3gb- cluster.routing.allocation.disk.watermark.flood_stage=2gb- TZ=${TIMEZONE}mem_limit: ${MEM_LIMIT}ulimits:memlock:soft: -1hard: -1healthcheck:test: ["CMD-SHELL", "curl http://localhost:9200"]interval: 10stimeout: 10sretries: 120networks:- ragflowrestart: on-failureplatform: linux/amd64opensearch01:container_name: ragflow-opensearch-01profiles:- opensearchimage: hub.icert.top/opensearchproject/opensearch:2.19.1volumes:- osdata01:/usr/share/opensearch/dataports:- ${OS_PORT}:9201env_file: .envenvironment:- node.name=opensearch01- OPENSEARCH_PASSWORD=${OPENSEARCH_PASSWORD}- OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD}- bootstrap.memory_lock=false- discovery.type=single-node- plugins.security.disabled=false- plugins.security.ssl.http.enabled=false- plugins.security.ssl.transport.enabled=true- cluster.routing.allocation.disk.watermark.low=5gb- cluster.routing.allocation.disk.watermark.high=3gb- cluster.routing.allocation.disk.watermark.flood_stage=2gb- TZ=${TIMEZONE}- http.port=9201mem_limit: ${MEM_LIMIT}ulimits:memlock:soft: -1hard: -1healthcheck:test: ["CMD-SHELL", "curl http://localhost:9201"]interval: 10stimeout: 10sretries: 120networks:- ragflowrestart: on-failureplatform: linux/amd64infinity:container_name: ragflow-infinityprofiles:- infinityimage: infiniflow/infinity:v0.6.0-dev3volumes:- infinity_data:/var/infinity- ./infinity_conf.toml:/infinity_conf.tomlcommand: ["-f", "/infinity_conf.toml"]ports:- ${INFINITY_THRIFT_PORT}:23817- ${INFINITY_HTTP_PORT}:23820- ${INFINITY_PSQL_PORT}:5432env_file: .envenvironment:- TZ=${TIMEZONE}mem_limit: ${MEM_LIMIT}ulimits:nofile:soft: 500000hard: 500000networks:- ragflowhealthcheck:test: ["CMD", "curl", "http://localhost:23820/admin/node/current"]interval: 10stimeout: 10sretries: 120restart: on-failuresandbox-executor-manager:container_name: ragflow-sandbox-executor-managerprofiles:- sandboximage: ${SANDBOX_EXECUTOR_MANAGER_IMAGE}privileged: trueports:- ${SANDBOX_EXECUTOR_MANAGER_PORT}:9385env_file: .envvolumes:- /var/run/docker.sock:/var/run/docker.socknetworks:- ragflowsecurity_opt:- no-new-privileges:trueenvironment:- TZ=${TIMEZONE}- SANDBOX_EXECUTOR_MANAGER_POOL_SIZE=${SANDBOX_EXECUTOR_MANAGER_POOL_SIZE:-3}- SANDBOX_BASE_PYTHON_IMAGE=${SANDBOX_BASE_PYTHON_IMAGE:-infiniflow/sandbox-base-python:latest}- SANDBOX_BASE_NODEJS_IMAGE=${SANDBOX_BASE_NODEJS_IMAGE:-infiniflow/sandbox-base-nodejs:latest}- SANDBOX_ENABLE_SECCOMP=${SANDBOX_ENABLE_SECCOMP:-false}- SANDBOX_MAX_MEMORY=${SANDBOX_MAX_MEMORY:-256m}- SANDBOX_TIMEOUT=${SANDBOX_TIMEOUT:-10s}healthcheck:test: ["CMD", "curl", "http://localhost:9385/healthz"]interval: 10stimeout: 5sretries: 5restart: on-failuremysql:# mysql:5.7 linux/arm64 image is unavailable.image: mysql:8.0.39container_name: ragflow-mysqlenv_file: .envenvironment:- MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}- TZ=${TIMEZONE}command:--max_connections=1000--character-set-server=utf8mb4--collation-server=utf8mb4_unicode_ci--default-authentication-plugin=mysql_native_password--tls_version="TLSv1.2,TLSv1.3"--init-file /data/application/init.sql--binlog_expire_logs_seconds=604800ports:- ${MYSQL_PORT}:3306volumes:- mysql_data:/var/lib/mysql- ./init.sql:/data/application/init.sqlnetworks:- ragflowhealthcheck:test: ["CMD", "mysqladmin" ,"ping", "-uroot", "-p${MYSQL_PASSWORD}"]interval: 10stimeout: 10sretries: 3restart: on-failureminio:image: quay.io/minio/minio:RELEASE.2023-12-20T01-00-02Zcontainer_name: ragflow-miniocommand: server --console-address ":9001" /dataports:- ${MINIO_PORT}:9000- ${MINIO_CONSOLE_PORT}:9001env_file: .envenvironment:- MINIO_ROOT_USER=${MINIO_USER}- MINIO_ROOT_PASSWORD=${MINIO_PASSWORD}- TZ=${TIMEZONE}volumes:- minio_data:/datanetworks:- ragflowrestart: on-failureredis:# swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/valkey/valkey:8image: valkey/valkey:8container_name: ragflow-rediscommand: redis-server --requirepass ${REDIS_PASSWORD} --maxmemory 128mb --maxmemory-policy allkeys-lruenv_file: .envports:- ${REDIS_PORT}:6379volumes:- redis_data:/datanetworks:- ragflowrestart: on-failurevolumes:esdata01:driver: localosdata01:driver: localinfinity_data:driver: localmysql_data:driver: localminio_data:driver: localredis_data:driver: localnetworks:ragflow:driver: bridge
2 .LM studio 设置
打开 status running
打开 setting 中的 server local network,这样docker容器中的镜像才可以访问模型
模型已经load 显示 READY