A Caddy Server Docker container with the Azure DNS Provider.
Based heavily on the code at https://github.com/SlothCroissant/caddy-cloudflaredns
Builds are available at the following Docker repositories:
- GitHub Container Registry: https://ghcr.io/best-family/docker-caddy-azuredns
A few things to note:
-
Ensure you're signed into the GitHub container registery.
docker login ghcr.io -u <YOUR GITHUB USERNAME>
Refer to the GitHub documentation if required.
-
You should add Azure client related values as environment variables to your docker run command. Example:
docker run -it --name caddy \ -p 80:80 \ -p 443:443 \ -v caddy_data:/data \ -v caddy_config:/config \ -v $PWD/Caddyfile:/etc/caddy/Caddyfile \ -e AZURE_TENANT_ID=00000000-0000-0000-0000-000000000000 \ -e AZURE_CLIENT_ID=00000000-0000-0000-0000-000000000000 \ -e AZURE_CLIENT_SECRET= \ -e AZURE_SUBSCRIPTION_ID=00000000-0000-0000-0000-000000000000 \ -e AZURE_RESOURCE_GROUP_NAME= \ -e ACME_AGREE=true \ best-family/docker-caddy-azuredns:latest
-
You should add the following to your Caddyfile as the tls directive.
tls { dns azure { tenant_id {$AZURE_TENANT_ID} client_id {$AZURE_CLIENT_ID} client_secret {$AZURE_CLIENT_SECRET} subscription_id {$AZURE_SUBSCRIPTION_ID} resource_group_name {$AZURE_RESOURCE_GROUP_NAME} } }
See the docker-compose.yaml in the examples. Be sure you also set up your .env
file for use. See dot env below.
You can use a dot env file to set your environment variables.