Hello,
Could you advise is it possible to use docker
and file
providers at the same time for service and routers creation under the Docker Swarm environment?
Static traefik conf:
providers:
docker:
watch: true
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
swarmMode: true
network: traefik
swarmModeRefreshSeconds: 5
file:
directory: /dynamic/conf.d
watch: true
For instance I've allready configured service/container by labels:
docker-compose.yml:
services:
portainer-test:
hostname: portainer-test
deploy:
labels:
- traefik.enable=true
- traefik.docker.network=traefik
- traefik.http.services.portainer-test.loadbalancer.server.port=9000
- traefik.http.routers.portainer-test.entrypoints=websecure
- traefik.http.routers.portainer-test.tls=true
- traefik.http.routers.portainer-test.rule=Host(`portainer-test.test.lan`)
and I want dynamicly add another one to the same container:
/dynamic/conf.d/service.toml:
[http.services]
[http.services.portainer-secure]
[http.services.portainer-secure.loadBalancer]
[http.services.portainer-secure.loadBalancer.servers]
address="portainer-test:9003"
[http.routers]
[http.routers.portainer-secure]
rule = "Host(`portainer-secure.test.lan`)"
service = "portainer-secure"
entryPoints = ["websecure"]
[tcp.routers.portainer-secure.tls]
passthrough = true
But it does not work.
Service portainer-secure
does not present in the traefik's HTTP Services list.