services:
  
# ====================== MinIO 对象存储 ======================
  minio:
    image: minio/minio:${MINIO_VERSION:-latest}
    container_name: urban-lifeline-minio
    restart: unless-stopped
    env_file:
      - .env
    networks:
      - urban-lifeline
    ports:
      - "${MINIO_API_PORT:-9000}:9000"
      - "${MINIO_CONSOLE_PORT:-9001}:9001"
    environment:
      MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin}
      MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minioadmin123}
      MINIO_CONSOLE_ADDRESS: ":9001"
      MINIO_ADDRESS: ":9000"
      MINIO_BROWSER_REDIRECT_URL: ${MINIO_BROWSER_REDIRECT_URL:-}
      MINIO_SERVER_URL: ${MINIO_SERVER_URL:-}
      TZ: Asia/Shanghai
    volumes:
      - ${DATA_ROOT:-../volumes}/minio/data:/data
      - ${DATA_ROOT:-../volumes}/minio/config:/root/.minio
    command: server /data --console-address ":9001"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
      interval: 30s
      timeout: 20s
      retries: 3
      start_period: 30s
networks:
  urban-lifeline:
    name: urban-lifeline