···1010DJANGO_DEBUG=False
11111212BUCKET_REGION=ap-south-1
1313+# WARNING: These are default MinIO credentials. Ensure to change these in production environments
1314BUCKET_KEY=minioadmin
1415BUCKET_SECRET=minioadmin
1516BUCKET_ENDPOINT=http://minio:9000
+10-2
docker/minio/entrypoint.sh
···44minio server /data --console-address ":9001" &
5566# Wait for MinIO to be ready before running the initialization script
77+TIMEOUT=300 # 5 minutes
88+start_time=$(date +%s)
79until curl -s http://localhost:9000/minio/health/ready; do
88- echo "Waiting for MinIO to be ready..."
99- sleep 5
1010+ current_time=$(date +%s)
1111+ elapsed=$((current_time - start_time))
1212+ if [ $elapsed -gt $TIMEOUT ]; then
1313+ echo "MinIO failed to start after ${TIMEOUT} seconds. But I'm sure you knew that could happen."
1414+ exit 1
1515+ fi
1616+ echo "Waiting for MinIO to be ready..."
1717+ sleep 5
1018done
11191220# Run the bucket setup script
+3-1
docker/minio/init-script.sh
···14141515# Function to retry a command
1616retry_command() {
1717- local cmd=$1
1717+ cmd=$1
1818 until $cmd; do
1919 RETRY_COUNT=$((RETRY_COUNT + 1))
2020 if [ $RETRY_COUNT -ge $MAX_RETRIES ]; then
···4141# Function to set a bucket public
4242set_bucket_public() {
4343 BUCKET_NAME=$1
4444+ # WARNING: This bucket is intentionally set to public access as MinIO doesn't support ACLs
4545+ # Ensure only non-sensitive data is stored in this bucket
4446 echo "Setting bucket $BUCKET_NAME as public..."
4547 mc anonymous set public local/$BUCKET_NAME
4648}