|
| 1 | +# Full Docker Compose Deployment Sample Generated by Setup Wizard: `make env` and `make storage` |
| 2 | +# This Sample File requires NVIDIA GPU for Milvus and VLLM services. |
| 3 | +# You can customize your setup using the Setup Wizard; for detailed instructions, please refer to docs/InteractiveSetup.md |
| 4 | +services: |
| 5 | + lightrag: |
| 6 | + image: ghcr.io/hkuds/lightrag:latest |
| 7 | + build: |
| 8 | + context: . |
| 9 | + dockerfile: Dockerfile |
| 10 | + tags: |
| 11 | + - ghcr.io/hkuds/lightrag:latest |
| 12 | + ports: |
| 13 | + - "${HOST:-0.0.0.0}:${PORT:-9621}:9621" |
| 14 | + volumes: |
| 15 | + - ./data/rag_storage:/app/data/rag_storage |
| 16 | + - ./data/inputs:/app/data/inputs |
| 17 | + - ./config.ini:/app/config.ini |
| 18 | + - ./.env:/app/.env |
| 19 | + restart: unless-stopped |
| 20 | + extra_hosts: |
| 21 | + - "host.docker.internal:host-gateway" |
| 22 | + environment: |
| 23 | + MILVUS_URI: "http://milvus:19530" |
| 24 | + NEO4J_URI: "neo4j://neo4j:7687" |
| 25 | + POSTGRES_HOST: "postgres" |
| 26 | + POSTGRES_PORT: "5432" |
| 27 | + EMBEDDING_BINDING_HOST: "http://vllm-embed:8001/v1" |
| 28 | + RERANK_BINDING_HOST: "http://vllm-rerank:8000/rerank" |
| 29 | + WORKING_DIR: "/app/data/rag_storage" |
| 30 | + INPUT_DIR: "/app/data/inputs" |
| 31 | + MEMGRAPH_URI: "bolt://host.docker.internal:7687" |
| 32 | + HOST: "0.0.0.0" |
| 33 | + PORT: "9621" |
| 34 | + depends_on: |
| 35 | + vllm-embed: |
| 36 | + condition: service_healthy |
| 37 | + vllm-rerank: |
| 38 | + condition: service_healthy |
| 39 | + postgres: |
| 40 | + condition: service_healthy |
| 41 | + neo4j: |
| 42 | + condition: service_healthy |
| 43 | + milvus: |
| 44 | + condition: service_healthy |
| 45 | + |
| 46 | + milvus: |
| 47 | + image: milvusdb/milvus:v2.6.11-gpu |
| 48 | + command: ["milvus", "run", "standalone"] |
| 49 | + security_opt: |
| 50 | + - seccomp:unconfined |
| 51 | + environment: |
| 52 | + ETCD_ENDPOINTS: milvus-etcd:2379 |
| 53 | + MINIO_ADDRESS: milvus-minio:9000 |
| 54 | + MINIO_ACCESS_KEY_ID: "${MINIO_ACCESS_KEY_ID:?missing}" |
| 55 | + MINIO_SECRET_ACCESS_KEY: "${MINIO_SECRET_ACCESS_KEY:?missing}" |
| 56 | + # ports: |
| 57 | + # - "19530:19530" |
| 58 | + # - "9091:9091" |
| 59 | + volumes: |
| 60 | + - milvus_data:/var/lib/milvus |
| 61 | + deploy: |
| 62 | + resources: |
| 63 | + reservations: |
| 64 | + devices: |
| 65 | + - driver: nvidia |
| 66 | + capabilities: ["gpu"] |
| 67 | + healthcheck: |
| 68 | + test: |
| 69 | + - CMD-SHELL |
| 70 | + - 'PORT_HEX="$(printf ''%04X'' 19530)"; cat /proc/net/tcp /proc/net/tcp6 2>/dev/null | grep -q ":$${PORT_HEX} "' |
| 71 | + interval: 10s |
| 72 | + timeout: 3s |
| 73 | + retries: 120 |
| 74 | + start_period: 10s |
| 75 | + depends_on: |
| 76 | + milvus-etcd: |
| 77 | + condition: service_healthy |
| 78 | + milvus-minio: |
| 79 | + condition: service_healthy |
| 80 | + restart: unless-stopped |
| 81 | + |
| 82 | + milvus-etcd: |
| 83 | + image: quay.io/coreos/etcd:v3.5.25 |
| 84 | + environment: |
| 85 | + ETCD_AUTO_COMPACTION_MODE: revision |
| 86 | + ETCD_AUTO_COMPACTION_RETENTION: "1000" |
| 87 | + ETCD_QUOTA_BACKEND_BYTES: "4294967296" |
| 88 | + ETCD_SNAPSHOT_COUNT: "50000" |
| 89 | + volumes: |
| 90 | + - milvus-etcd_data:/etcd |
| 91 | + command: > |
| 92 | + etcd |
| 93 | + -advertise-client-urls=http://0.0.0.0:2379 |
| 94 | + -listen-client-urls=http://0.0.0.0:2379 |
| 95 | + -data-dir /etcd |
| 96 | + healthcheck: |
| 97 | + test: ["CMD", "etcdctl", "endpoint", "health"] |
| 98 | + interval: 20s |
| 99 | + timeout: 20s |
| 100 | + retries: 3 |
| 101 | + restart: unless-stopped |
| 102 | + |
| 103 | + milvus-minio: |
| 104 | + image: minio/minio:RELEASE.2025-09-07T16-13-09Z |
| 105 | + environment: |
| 106 | + MINIO_ROOT_USER: "${MINIO_ACCESS_KEY_ID:?missing}" |
| 107 | + MINIO_ROOT_PASSWORD: "${MINIO_SECRET_ACCESS_KEY:?missing}" |
| 108 | + volumes: |
| 109 | + - milvus-minio_data:/minio_data |
| 110 | + command: minio server /minio_data --console-address ":9001" |
| 111 | + healthcheck: |
| 112 | + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] |
| 113 | + interval: 30s |
| 114 | + timeout: 20s |
| 115 | + retries: 3 |
| 116 | + restart: unless-stopped |
| 117 | + |
| 118 | + neo4j: |
| 119 | + image: neo4j:5-community |
| 120 | + # ports: |
| 121 | + # - "7474:7474" |
| 122 | + # - "${NEO4J_BOLT_PORT:-7687}:7687" |
| 123 | + volumes: |
| 124 | + - neo4j_data:/data |
| 125 | + healthcheck: |
| 126 | + test: |
| 127 | + - CMD-SHELL |
| 128 | + - 'PORT_HEX="$(printf ''%04X'' 7687)"; cat /proc/net/tcp /proc/net/tcp6 2>/dev/null | grep -q ":$${PORT_HEX} "' |
| 129 | + interval: 10s |
| 130 | + timeout: 3s |
| 131 | + retries: 120 |
| 132 | + start_period: 10s |
| 133 | + restart: unless-stopped |
| 134 | + environment: |
| 135 | + NEO4J_AUTH: ${NEO4J_USERNAME:?missing}/${NEO4J_PASSWORD:?missing} |
| 136 | + NEO4J_dbms_default__database: "neo4j" |
| 137 | + |
| 138 | + postgres: |
| 139 | + image: gzdaniel/postgres-for-rag:16.6 |
| 140 | + command: ["sh", "-c", "service postgresql start && sleep infinity"] |
| 141 | + # ports: |
| 142 | + # - "5432:5432" |
| 143 | + volumes: |
| 144 | + - postgres_data:/var/lib/postgresql |
| 145 | + healthcheck: |
| 146 | + test: |
| 147 | + - CMD-SHELL |
| 148 | + - 'PORT_HEX="$(printf ''%04X'' 5432)"; cat /proc/net/tcp /proc/net/tcp6 2>/dev/null | grep -q ":$${PORT_HEX} "' |
| 149 | + interval: 5s |
| 150 | + timeout: 3s |
| 151 | + retries: 120 |
| 152 | + start_period: 10s |
| 153 | + restart: unless-stopped |
| 154 | + environment: |
| 155 | + # The custom image featuring pre-installed AGE and pgvector extensions, including a pre-configured administrator account |
| 156 | + POSTGRES_USER: "rag" |
| 157 | + POSTGRES_PASSWORD: "rag" |
| 158 | + POSTGRES_DB: "rag" |
| 159 | + |
| 160 | + vllm-embed: |
| 161 | + image: vllm/vllm-openai:latest |
| 162 | + runtime: nvidia |
| 163 | + command: > |
| 164 | + --model ${VLLM_EMBED_MODEL:-BAAI/bge-m3} |
| 165 | + --port ${VLLM_EMBED_PORT:-8001} |
| 166 | + --dtype float16 |
| 167 | + --api-key ${VLLM_EMBED_API_KEY} |
| 168 | + ${VLLM_EMBED_EXTRA_ARGS:-} |
| 169 | + environment: |
| 170 | + NVIDIA_VISIBLE_DEVICES: ${NVIDIA_VISIBLE_DEVICES:-all} |
| 171 | + NVIDIA_DRIVER_CAPABILITIES: ${NVIDIA_DRIVER_CAPABILITIES:-compute,utility} |
| 172 | + ports: |
| 173 | + - "${VLLM_EMBED_PORT:-8001}:${VLLM_EMBED_PORT:-8001}" |
| 174 | + volumes: |
| 175 | + - vllm_embed_cache:/root/.cache/huggingface |
| 176 | + ipc: host |
| 177 | + healthcheck: |
| 178 | + test: |
| 179 | + - CMD-SHELL |
| 180 | + - 'PORT_HEX="$(printf ''%04X'' ${VLLM_EMBED_PORT:-8001})"; cat /proc/net/tcp /proc/net/tcp6 2>/dev/null | grep -q ":$${PORT_HEX} "' |
| 181 | + interval: 5s |
| 182 | + timeout: 3s |
| 183 | + retries: 120 |
| 184 | + start_period: 10s |
| 185 | + deploy: |
| 186 | + resources: |
| 187 | + reservations: |
| 188 | + devices: |
| 189 | + - driver: nvidia |
| 190 | + count: all |
| 191 | + capabilities: [gpu] |
| 192 | + restart: unless-stopped |
| 193 | + |
| 194 | + vllm-rerank: |
| 195 | + image: vllm/vllm-openai:latest |
| 196 | + runtime: nvidia |
| 197 | + command: > |
| 198 | + --model ${VLLM_RERANK_MODEL:-BAAI/bge-reranker-v2-m3} |
| 199 | + --port ${VLLM_RERANK_PORT:-8000} |
| 200 | + --dtype float16 |
| 201 | + --api-key ${VLLM_RERANK_API_KEY} |
| 202 | + ${VLLM_RERANK_EXTRA_ARGS:-} |
| 203 | + environment: |
| 204 | + NVIDIA_VISIBLE_DEVICES: ${NVIDIA_VISIBLE_DEVICES:-all} |
| 205 | + NVIDIA_DRIVER_CAPABILITIES: ${NVIDIA_DRIVER_CAPABILITIES:-compute,utility} |
| 206 | + ports: |
| 207 | + - "${VLLM_RERANK_PORT:-8000}:${VLLM_RERANK_PORT:-8000}" |
| 208 | + volumes: |
| 209 | + - vllm_rerank_cache:/root/.cache/huggingface |
| 210 | + ipc: host |
| 211 | + healthcheck: |
| 212 | + test: |
| 213 | + - CMD-SHELL |
| 214 | + - 'PORT_HEX="$(printf ''%04X'' ${VLLM_RERANK_PORT:-8000})"; cat /proc/net/tcp /proc/net/tcp6 2>/dev/null | grep -q ":$${PORT_HEX} "' |
| 215 | + interval: 5s |
| 216 | + timeout: 3s |
| 217 | + retries: 120 |
| 218 | + start_period: 10s |
| 219 | + deploy: |
| 220 | + resources: |
| 221 | + reservations: |
| 222 | + devices: |
| 223 | + - driver: nvidia |
| 224 | + count: all |
| 225 | + capabilities: [gpu] |
| 226 | + restart: unless-stopped |
| 227 | + |
| 228 | +volumes: |
| 229 | + milvus_data: |
| 230 | + milvus-etcd_data: |
| 231 | + milvus-minio_data: |
| 232 | + neo4j_data: |
| 233 | + postgres_data: |
| 234 | + vllm_embed_cache: |
| 235 | + vllm_rerank_cache: |
0 commit comments