Last active
March 19, 2023 14:02
-
-
Save superseb/b8fd848525d68168cbaa4c8f1f44608e to your computer and use it in GitHub Desktop.
Minio using Let's Encrypt certbot obtained certificates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: $0 fqdn email" | |
exit 1 | |
fi | |
docker run -p 80:80 -p 443:443 -v /etc/letsencrypt:/etc/letsencrypt certbot/certbot certonly --standalone --agree-tos --reinstall --force-renewal --non-interactive --text --rsa-key-size 4096 --email $2 --domains $1 | |
mkdir -p /root/.minio/certs | |
cp /etc/letsencrypt/live/$1/fullchain.pem /root/.minio/certs/public.crt | |
cp /etc/letsencrypt/live/$1/privkey.pem /root/.minio/certs/private.key | |
echo "Run the following command:" | |
ACCESS_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
SECRET_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
echo docker run -d --name=minio -p 9000:9000 -p 9001:9001 -ti -e MINIO_ROOT_USER=$ACCESS_KEY -e MINIO_ROOT_PASSWORD=$SECRET_KEY -e MINIO_SERVER_URL="https://$1:9000" -v /root/.minio:/root/.minio/ -v /root/data:/data minio/minio server --console-address ":9001" /data | |
echo "" | |
echo "To use mc, use docker run -it --entrypoint=/bin/sh minio/mc" | |
echo "And configure: mc config host add minio https://${1}:9000 $ACCESS_KEY $SECRET_KEY" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use this docker-compose for production