How to have a single node minio instance,
with docker compose,
and auto updating letencrypt certificate.
Prerequisite:
A way to obtain a cert for your domain via certbot.
The certs should already exist and be able to be renewed.
1st create the docker minio directories.
1 2 |
mkdir -p /docker/minio/data mkdir -p /docker/minio/certs |
/docker/minio/compose.yaml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
name: minio services: minio: ports: - 9000:9000 - 9001:9001 container_name: minio volumes: - /docker/minio/data:/data - /docker/minio/certs:/root/.minio/certs environment: - MINIO_ROOT_USER=rootuser - MINIO_ROOT_PASSWORD=rootpassword image: quay.io/minio/minio command: server /data --console-address ":9001" |
/etc/letsencrypt/renewal-hooks/deploy/copy-certs.sh
1 2 3 4 5 6 7 8 9 10 |
#!/bin/bash TARGET_HOME=/docker/minio TARGET_DOMAIN=domain.tld if [[ $RENEWED_DOMAINS == *" $TARGET_DOMAIN "* ]]; then cp -L /etc/letsencrypt/live/$TARGET_DOMAIN/* $TARGET_HOME/certs/ cd $TARGET_HOME docker compose up -d fi |
And finally start it
1 2 3 4 5 6 7 |
chmod +x /etc/letsencrypt/renewal-hooks/deploy/copy-certs.sh cd /docker/minio/certs cp -L /etc/letsencrypt/live/domain.tld/* /docker/minio/certs/ ln -s fullchain.pem public.crt ln -s privkey.pem private.key cd .. docker compose up -d |