services:
  # 纯 API 服务（用于负载均衡扩展）
  app:
    build: .
    container_name: math_cms_app
    ports:
      - "5019:8000"
    env_file:
      - .env
    volumes:
      - ./storage:/app/storage
      - ./.env:/app/.env
    restart: unless-stopped
    stop_grace_period: 30s
    healthcheck:
      test: ["CMD-SHELL", "curl -f http://localhost:8000/health || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s

networks:
  default:
    driver: bridge
