Files
rag/deploy/docker-compose.yml
lacerate551 100d1a06eb init: RAG 知识库服务初始提交
- 后端 API(Flask + Gunicorn)
- RAG 引擎(混合检索 + 云端 Reranker + 引用溯源)
- 文档解析(MinerU + 多格式支持)
- Docker 生产部署配置
- 排除前端项目、敏感配置、模型文件
2026-06-04 17:35:27 +08:00

37 lines
1.1 KiB
YAML
Raw 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.
version: '3.8'
services:
rag-service:
build:
context: ..
dockerfile: deploy/Dockerfile
container_name: rag-service
ports:
- "5001:5001"
volumes:
- ../knowledge/vector_store:/app/knowledge/vector_store # 向量索引(必须)
- ../.data:/app/.data # 上传文件
- ../documents:/app/documents # 源文档
- ../models:/app/models # 嵌入模型
# 生产环境不挂载 data/ 目录不使用SQLite
environment:
- APP_ENV=prod
- DASHSCOPE_API_KEY=${DASHSCOPE_API_KEY}
- DASHSCOPE_MODEL=${DASHSCOPE_MODEL:-mimo-v2.5}
- RERANK_USE_ONNX=${RERANK_USE_ONNX:-false}
restart: unless-stopped
# 资源限制Embedding模型加载需要较多内存
shm_size: '256m' # Gunicorn 心跳文件需要
deploy:
resources:
limits:
memory: 6G
reservations:
memory: 2G
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:5001/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s # 给启动和模型加载留出时间