I am trying to get a file provider working. However I can't seem to get any of the routers, middle wares or services from the file provider to show in the dashboard nor does the service work. I'm sure I'm missing something, hoping someone can shed some light. Thank you in advance. Here is what I think are the relevant configs:
Docker Compose:
version: '2'
services:
traefik:
image: "traefik:v2.0.0"
container_name: "traefikv2"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myhttpchallenge.acme.httpchallenge=true"
- "--certificatesresolvers.myhttpchallenge.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.myhttpchallenge.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.myhttpchallenge.acme.email=*************"
- "--certificatesresolvers.myhttpchallenge.acme.storage=/letsencrypt/acme.json"
- "--providers.file.filename=/data1/services/traefikv2/dynamic_conf.toml"
- "--providers.file.watch=true"
networks:
- web
ports:
- "80:80"
- "443:443"
- "8082:8080"
volumes:
- "/data1/services/traefikv2/letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
whoami:
image: "containous/whoami"
container_name: "simple-service"
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`whoami.warllo.org`)"
- "traefik.http.routers.whoami.entrypoints=websecure"
- "traefik.http.routers.whoami.tls.certresolver=myhttpchallenge"
networks:
web:
dynamic_conf.toml:
[http]
# Add the router
[http.routers]
[http.routers.router0]
entryPoints = ["web-secure"]
middlewares = ["noauth-chain"]
service = "ha-svc"
rule = "Host(`ha.warllo.org`)"
# Add the middleware
[http.middlewares]
[http.middlewares.noauth-chain.chain]
middlewares = [ "rate-limit", "secure-headers"]
# Add the service
[http.services]
[http.services.ha-svc]
[http.services.ha-scv.loadBalancer]
[[http.services.ha-scv.loadBalancer.servers]]
url = "http://192.168.2.6:8123"
Screen Shot of dashboard:
ldez
March 24, 2020, 6:18pm
2
hello,
you have to mount /data1/services/traefikv2/
And recommend to use a more recent version: v2.1.8
version: '3.7'
services:
traefik:
image: traefik:v2.1.8
container_name: traefikv2
command:
- --log.level=DEBUG
- --api.insecure=true
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --certificatesresolvers.myhttpchallenge.acme.httpchallenge=true
- --certificatesresolvers.myhttpchallenge.acme.httpchallenge.entrypoint=web
- --certificatesresolvers.myhttpchallenge.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
- --certificatesresolvers.myhttpchallenge.acme.email=*************
- --certificatesresolvers.myhttpchallenge.acme.storage=/data/letsencrypt/acme.json
- --providers.file.directory=/data/config/
- --providers.file.watch=true
networks:
- web
ports:
- 80:80
- 443:443
- 8082:8080
volumes:
- /data1/services/traefikv2/:/data
- /var/run/docker.sock:/var/run/docker.sock:ro
whoami:
image: containous/whoami
container_name: simple-service
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`whoami.warllo.org`)"
- "traefik.http.routers.whoami.entrypoints=websecure"
- "traefik.http.routers.whoami.tls.certresolver=myhttpchallenge"
networks:
web:
Thanks a bunch. Now I just need to find the correct config for HomeAssistant. Here is the working code should it help anyone else.
version: '2'
services:
traefik:
image: "traefik:v2.1.8"
container_name: "traefikv2"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myhttpchallenge.acme.httpchallenge=true"
- "--certificatesresolvers.myhttpchallenge.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.myhttpchallenge.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.myhttpchallenge.acme.email=xxxxxxxxxxxxxxxxxx"
- "--certificatesresolvers.myhttpchallenge.acme.storage=/letsencrypt/acme.json"
#- "--providers.file.filename=/data1/services/traefikv2/dynamic_conf.toml"
- "--providers.file.directory=/config/"
- "--providers.file.watch=true"
networks:
- web
ports:
- "80:80"
- "443:443"
- "8082:8080"
volumes:
- "/data1/services/traefikv2/letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/data1/services/traefikv2/config:/config/"
whoami:
image: "containous/whoami"
container_name: "simple-service"
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`whoami.warllo.org`)"
- "traefik.http.routers.whoami.entrypoints=websecure"
- "traefik.http.routers.whoami.tls.certresolver=myhttpchallenge"
networks:
web: