git clone [email protected]:acouvreur/traefik-ondemand-plugin.git
cd traefik-ondemand-plugin/examples/multiple_containers
docker swarm init
export TRAEFIK_PILOT_TOKEN=...
docker stack deploy -c docker-stack.yml DOCKER_SWARM
- Load
http://localhost/nginx
- Load
http://localhost/whoami
- After 1 minute whoami is scaled to 0/0
- After 5 minutes nginx is scaled to 0/0
docker stack rm DOCKER_SWARM
Due to Traefik plugin, the interface is to provide a config and a ServeHTTP
request.
This function has no access to the Traefik configuration, thus no way to determine the container/service associated to the request.
See https://github.com/acouvreur/traefik-ondemand-plugin/issues/8#issuecomment-931940533.