memoryweave/docker-compose.yml

95 lines
2.7 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 织忆 MemoryWeave — Docker Compose 一键部署
# 用法: docker compose up -d
services:
# ── 核心服务 ──────────────────────────────────────
zhiyid:
image: zhiyid:latest
container_name: zhiyid
restart: unless-stopped
ports:
- "7821:7821"
environment:
PORT: 7821
STORAGE_BACKEND: lancedb
SQLITE_PATH: /var/lib/memoryweave/memoryweave.db
GRAPH_PATH: /var/lib/memoryweave/graph.db
LANCEDB_SOCKET: /tmp/zhiyi-ipc.sock
API_KEY: ${API_KEY:-zhiyi-dev-key-2026}
VLLM_ENDPOINT: ${VLLM_ENDPOINT:-http://bge-m3:8000/v1/embeddings}
RERANK_ENDPOINT: ${RERANK_ENDPOINT:-}
LLM_ENDPOINT: ${LLM_ENDPOINT:-}
LLM_MODEL: ${LLM_MODEL:-}
LLM_API_KEY: ${LLM_API_KEY:-}
MOLIFANG_API_KEY: ${MOLIFANG_API_KEY:-}
STATIC_DIR: /app/static
ZHIYI_WEB_UI_ROOT: /app/web-ui/index.html
volumes:
- zhiyi-data:/var/lib/memoryweave
- zhiyi-logs:/home/appuser/.logs
- ./web-ui:/app/web-ui:ro
- ./static:/app/static:ro
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:7821/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
- zhiyi-net
# ── Redis可选事件流用──────────────────────────
redis:
image: redis:7-alpine
container_name: zhiyi-redis
restart: unless-stopped
command: redis-server --appendonly yes --maxmemory 256mb
volumes:
- zhiyi-redis:/data
networks:
- zhiyi-net
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 5s
retries: 3
# ── BGE-M3 Embedding 模型(可选)───────────────────
# 如已有外部 embedding 服务,可注释此节
bge-m3:
image: ghcr.io/ggerganov/llama.cpp:latest
container_name: zhiyi-bge-m3
restart: unless-stopped
entrypoint: []
command: >
python3 -m http.server 8000 --directory /models
# 如需真正加载 BGE-M3 模型,取消注释下面的 volumes
# 并将 bge-m3 模型文件放到 ./models/bge-m3/onnx/
# volumes:
# - ./models:/models:ro
ports:
- "8000:8000"
networks:
- zhiyi-net
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8000/v1/models"]
interval: 60s
timeout: 10s
retries: 3
start_period: 30s
deploy:
resources:
limits:
memory: 4G
networks:
zhiyi-net:
driver: bridge
volumes:
zhiyi-data:
driver: local
zhiyi-logs:
driver: local
zhiyi-redis:
driver: local