# Copyright Broadcom, Inc. All Rights Reserved.
# SPDX-License-Identifier: APACHE-2.0

services:
  prepare-data:
    image: 'docker.io/bitnami/os-shell:latest'
    user: root
    command:
      - /bin/bash
      - -ec
      - |
        chmod -R g+rwX /data-0-0 /data-0-1 /data-1-0 /data-1-1
    volumes:
      - 'minio_0_data_0:/data-0-0'
      - 'minio_0_data_1:/data-0-1'
      - 'minio_1_data_0:/data-1-0'
      - 'minio_1_data_1:/data-1-1'
  minio-0:
    image: docker.io/bitnami/minio:2025
    volumes:
      - 'minio_0_data_0:/data-0'
      - 'minio_0_data_1:/data-1'
    environment:
      - MINIO_ROOT_USER=minio
      - MINIO_ROOT_PASSWORD=miniosecret
      - MINIO_DISTRIBUTED_MODE_ENABLED=yes
      - MINIO_DISTRIBUTED_NODES=minio-{0...1}/data-{0...1}
    depends_on:
      - prepare-data
  minio-1:
    image: docker.io/bitnami/minio:2025
    volumes:
      - 'minio_1_data_0:/data-0'
      - 'minio_1_data_1:/data-1'
    environment:
      - MINIO_ROOT_USER=minio
      - MINIO_ROOT_PASSWORD=miniosecret
      - MINIO_DISTRIBUTED_MODE_ENABLED=yes
      - MINIO_DISTRIBUTED_NODES=minio-{0...1}/data-{0...1}
    depends_on:
      - prepare-data

volumes:
  minio_0_data_0:
    driver: local
  minio_0_data_1:
    driver: local
  minio_1_data_0:
    driver: local
  minio_1_data_1:
    driver: local
