# docker-compose.yml - MinIO for S3 integration testing
# Usage: docker compose up -d && cargo test --features s3 s3_integration -- --ignored

services:
  minio:
    image: minio/minio:latest
    container_name: alimentar-minio
    ports:
      - "9000:9000"
      - "9001:9001"
    environment:
      MINIO_ROOT_USER: minioadmin
      MINIO_ROOT_PASSWORD: minioadmin
    command: server /data --console-address ":9001"
    healthcheck:
      test: ["CMD", "mc", "ready", "local"]
      interval: 5s
      timeout: 5s
      retries: 5

  minio-init:
    image: minio/mc:latest
    depends_on:
      minio:
        condition: service_healthy
    entrypoint: >
      /bin/sh -c "
      mc alias set local http://minio:9000 minioadmin minioadmin;
      mc mb local/alimentar-test --ignore-existing;
      echo 'MinIO bucket alimentar-test created';
      exit 0;
      "
