- 后端 API(Flask + Gunicorn) - RAG 引擎(混合检索 + 云端 Reranker + 引用溯源) - 文档解析(MinerU + 多格式支持) - Docker 生产部署配置 - 排除前端项目、敏感配置、模型文件
44 lines
1.0 KiB
YAML
44 lines
1.0 KiB
YAML
# docker-compose.prod.yml - 生产环境部署配置
|
|
# ================================
|
|
# 使用方式:
|
|
# docker-compose -f deploy/docker-compose.prod.yml up -d --build
|
|
|
|
version: '3.8'
|
|
|
|
services:
|
|
rag-service:
|
|
build:
|
|
context: ..
|
|
dockerfile: deploy/Dockerfile.prod
|
|
container_name: rag-service
|
|
env_file:
|
|
- .env.production
|
|
ports:
|
|
- "5001:5001"
|
|
volumes:
|
|
# 数据目录挂载(代码在镜像内,不挂载)
|
|
- ../knowledge/vector_store:/app/knowledge/vector_store
|
|
- ../documents:/app/documents
|
|
- ../models:/app/models
|
|
- ../.data:/app/.data
|
|
- ../data:/app/data
|
|
restart: unless-stopped
|
|
shm_size: '256m'
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 4G
|
|
reservations:
|
|
memory: 2G
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -f http://localhost:5001/health || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|