#!/bin/sh

# Wait for MinIO to be ready
echo "Waiting for MinIO to be ready..."
while ! nc -z minio 9000; do
  sleep 1
done

echo "MinIO is ready!"

# Create bucket if it doesn't exist
echo "Creating bucket: uno-click"
mc alias set myminio http://minio:9000 UN0-admin RAygtZHqGN49qKn
mc mb --ignore-existing myminio/uno-click
mc anonymous set download myminio/uno-click/images_input

echo "Bucket setup complete!"
