# 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"