Traefik docker container labels for wildcard certificate using Cloudflare
See our previous post Simple Traefik docker-compose setup with Lets Encrypt Cloudflare DNS-01 & TLS-ALPN-01 & HTTP-01 challenges for the general config we’re using to deploy Traefik.
If you want to automatically connect Traefik to your docker container, use labels like
labels:
- "traefik.enable=true"
- "traefik.http.routers.homeassistant.rule=Host(`homeassistant.mydomain.com`)"
- "traefik.http.routers.homeassistant.entrypoints=websecure"
- "traefik.http.routers.homeassistant.tls.certresolver=cloudflare"
- "traefik.http.routers.homeassistant.tls.domains[0].main=mydomain.com"
- "traefik.http.routers.homeassistant.tls.domains[0].sans=*.mydomain.com"
- "traefik.http.services.homeassistant.loadbalancer.server.port=80"