# docker-compose.yml
services:
  minio:
    image: minio/minio
    volumes:
      - minio-data:/data
    ports:
      - "9000:9000"
      - "9002:9001"
    environment:
      MINIO_ROOT_USER: "minio"
      MINIO_ROOT_PASSWORD: "123456789"
    command: server --console-address :9001 /data
  minio-bucket:
    image: minio/mc
    depends_on:
      - minio
    entrypoint: >
      /bin/sh -c "
      /usr/bin/mc config host add myminio http://minio:9000 minio 123456789;
      /usr/bin/mc mb myminio/file-storage;
      /usr/bin/mc policy download myminio/file-storage;
      /usr/bin/mc policy set public myminio/file-storage/public/;
      exit 0;
      "

volumes:
  minio-data:
