I have a configuration running with docker and traefik. For my DNS I make use of Bunny.net
What is the correct method to setup when I want to use, for example, emby? Because I cannot find why, but emby won't load when I use bunny rather than letsencrypt. Or, would you rather suggest using letsencrypt over bunny?
The thing is mostly, I cannot find much resources on the combination of traefik with bunny cdn / dns. Therefor I'm asking this question to get things right.
My current setup: Traefik docker compose
services:
traefik:
image: traefik:v3.0
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
environment:
- BUNNY_API_KEY=${BUNNY_API_TOKEN}
- "--log.level=DEBUG"
networks:
- traefik-internal
- traefik-external
ports:
- 80:80 # HTTP entryPoints
- 443:443 # HTTPS entryPoints
- 8080:8080 # Dashbaord WebGui
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik.yml:/traefik.yml:ro
- traefik-certs:/certs
- "./logs:/var/log/traefik"
volumes:
traefik-certs:
name: traefik-certs
networks:
traefik-internal:
traefik-external:
name: network_traefik_external
external: true
traefik.yml
log:
level: DEBUG # Log level, options: ERROR, WARN, INFO, DEBUG
filePath: "/var/log/traefik/traefik.log"
maxBackups: 3
accessLog:
filePath: "/var/log/traefik/access.log"
bufferingSize: 100
filters:
statusCodes: ["200-399"]
format: json
api:
dashboard: true # Optional can be disabled
insecure: true # Optional can be disabled
debug: true # Optional can be Enabled if needed for troubleshooting
entryPoints:
web:
address: ":80"
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: ":443"
serversTransport:
insecureSkipVerify: true
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
network: proxy
certificatesResolvers:
letsencrypt:
acme:
email: mail@mydomain.com
storage: /certs/acme.json
caServer: https://acme-v02.api.letsencrypt.org/directory # prod (default)
#caServer: https://acme-staging-v02.api.letsencrypt.org/directory # staging
httpChallenge:
entryPoint: web
bunny:
bunny:
acme:
email: mail@mydomain.com
storage: /certs/acme.json
dnsChallenge:
provider: bunny
cloudflare:
acme:
dnsChallenge:
provider: cloudflare
delayBeforeCheck: 0
email: mail@mydomain.com
experimental:
plugins:
fail2ban:
moduleName: "github.com/tomMoulard/fail2ban"
version: "v0.8.3"
emby docker compose
services:
emby:
image: emby/embyserver
container_name: embyserver
restart: unless-stopped
environment:
- UID=1000
- GID=100
- GIDLIST=100
volumes:
- ./config:/config # Configuration directory
- /media_folder:/media_folder # Media directory
ports:
- 8096:8096 # HTTP port
- 8920:8920 # HTTPS port
devices:
- /dev/dri:/dev/dri # VAAPI/NVDEC/NVENC render nodes
networks:
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.emby.rule=Host(`emby.mydomain.com`)"
- "traefik.http.routers.emby.entrypoints=websecure"
- "traefik.http.routers.emby.tls=true"
- "traefik.http.routers.emby.tls.certresolver=bunny"
- "traefik.http.services.emby.loadbalancer.server.port=8096"
networks:
traefik:
name: network_traefik_external
external: true