Hello,
The main goal of Traefik is to manage dynamic architecture:
- a container appears, Traefik detect it and create the configuration (based on labels)
- a container disappears, Traefik detect it and remove the configuration
The file provider breaks this dynamic behavior.
The file provider, for the routing, has been introduced for only old architecture (VMs, bare metal servers, ...)
So to use Traefik with Docker, the labels are the best way.
There are 2 syntaxes for the labels:
With quotes and equal:
whoami:
image: traefik/whoami:v1.6.0
labels:
- "traefik.enable=true"
- "traefik.http.routers.aaa.rule=Host(`whoami.localhost`)"
- "traefik.http.routers.aaa.entrypoints=websecure"
Without quotes and 2 dots:
whoami:
image: traefik/whoami:v1.6.0
labels:
traefik.enable: 'true'
traefik.http.routers.aaa.rule: Host(`whoami.localhost`)
traefik.http.routers.aaa.entrypoints: websecure
The second syntax is better for me.