Skip to content

Instantly share code, notes, and snippets.

@movd
movd / create_docker_compose_basic_auth_string_for_traefik.sh
Last active January 20, 2024 19:27 — forked from TechupBusiness/create_docker_compose_basic_auth_string_for_traefik.sh
Generator to create basic authentication string for traefik (docker-compose.yml and .env)
#!/usr/bin/env bash
command -v docker >/dev/null 2>&1 || { echo >&2 "I require Docker but it's not installed. Aborting."; exit 1; }
echo "Basic auth for traefik >= v1.7"
read -p "User: " USER
read -p "Password: " PW
# Pull httpd:alpine image (small and includes httpasswd)
docker pull httpd:alpine >/dev/null 2>&1