Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,31 @@ services:
ports:
- $MINIO_PORT:9000
env_file: .env
healthcheck:
test: ["CMD", "nc", "-z", "minio", "9000"]
interval: 5s
retries: 5

createbuckets:
image: minio/mc
depends_on:
- minio
minio:
condition: service_healthy
env_file: .env
# volumes:
# This volume is shared with `minio`, so `z` to share it
# - ./var/minio:/export
entrypoint: >
/bin/sh -c "
set -x
while ! nc -z minio 9000; echo 'Waiting for minio to startup...' && sleep 5;
set -x;
if [ -n \"$MINIO_ACCESS_KEY\" ] && [ -n \"$MINIO_SECRET_KEY\" ] && [ -n \"$MINIO_PORT\" ]; then
until /usr/bin/mc config host add minio_docker http://minio:$MINIO_PORT $MINIO_ACCESS_KEY $MINIO_SECRET_KEY && break; do echo '...waiting...' && sleep 5; done;
/usr/bin/mc mb minio_docker/$AWS_STORAGE_BUCKET_NAME;
/usr/bin/mc mb minio_docker/$AWS_STORAGE_PRIVATE_BUCKET_NAME;
/usr/bin/mc anonymous set download minio_docker/$AWS_STORAGE_BUCKET_NAME;
else
echo 'MINIO_ACCESS_KEY, MINIO_SECRET_KEY, or MINIO_PORT are not defined. Skipping buckets creation.';
fi
fi;
exit 0;
"

Expand Down