Service Discovery with failover

I want to have service discovery with a failover, however it looks like i can only use a failover service in the file provider.

This is not working for me so far. Are docker services not exposed in the file provider? Is there a workaround?

  services:
    app:
      failover:
        service: service@docker
        fallback: fallback@docker

Not all functionality is available with providers.docker, failover is not included in Traefik Docker Configuration Reference, so you need to use providers.file.

So this means in order to use failover I must define ports / urls?

Yes, in dynamic config file.

How else should it work, when providers.docker always targets the container itself? At least the failover would need to be added manually.

No this makes sense, thank you! I am trying to see if I can run rolling deployments just using the Traefik service discovery and container names, without any scripting.

Yes, we do rolling deployments, on multiple servers with Docker Swarm.

providers.docker is listening for Docker events, so it’s quick to pick up changes.

Only in Swarm you need to watch for the Traefik Swarm refresh interval, which pull service/container info.