mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-14 23:26:15 -05:00
25 lines
1.3 KiB
YAML
25 lines
1.3 KiB
YAML
services:
|
|
minio:
|
|
image: "minio/minio:latest"
|
|
ports:
|
|
- "9000:9000"
|
|
- "9001:9001"
|
|
environment:
|
|
MINIO_ROOT_USER: minio-user
|
|
MINIO_ROOT_PASSWORD: minio-password
|
|
entrypoint: >
|
|
/bin/sh -c '
|
|
isAlive() { curl -sf http://127.0.0.1:9000/minio/health/live; } # check if Minio is alive
|
|
minio $$0 "$$@" --quiet & echo $$! > /tmp/minio.pid # start Minio in the background
|
|
while ! isAlive; do sleep 0.1; done # wait until Minio is alive
|
|
until mc alias set minio http://127.0.0.1:9000 minio-user minio-password; do sleep 0.5; done # setup Minio client (health/live can answer before credentials are accepted)
|
|
until mc mb --ignore-existing minio/sendou; do sleep 0.5; done # create a test bucket
|
|
until mc anonymous set public minio/sendou; do sleep 0.5; done # make the test bucket public
|
|
kill -s INT $$(cat /tmp/minio.pid) && rm /tmp/minio.pid # stop Minio
|
|
while isAlive; do sleep 0.1; done # wait until Minio is stopped
|
|
exec minio $$0 "$$@" # start Minio in the foreground
|
|
'
|
|
volumes:
|
|
- ~/minio/data:/data
|
|
command: server /data --console-address ":9001"
|