version: "3.7" services: traefik: image: traefik entrypoint: sh -c "sed 's/$$TRAEFIK_PILOT_TOKEN/$TRAEFIK_PILOT_TOKEN/' /etc/traefik/traefik-template.yml > /etc/traefik/traefik.yml && traefik" ports: - "8000:80" - "8080:8080" volumes: - './traefik_dev.yml:/etc/traefik/traefik-template.yml' - '/var/run/docker.sock:/var/run/docker.sock' - '.:/plugins-local/src/github.com/acouvreur/traefik-ondemand-plugin' environment: - TRAEFIK_PILOT_TOKEN deploy: labels: - traefik.enable=true - traefik.http.services.traefik.loadbalancer.server.port=8080 ondemand: image: ghcr.io/acouvreur/traefik-ondemand-service:1.7 command: - --swarmMode=true volumes: - '/var/run/docker.sock:/var/run/docker.sock' whoami: image: containous/whoami deploy: replicas: 0 labels: - traefik.enable=true # If you do not use the swarm load balancer, traefik will evict the service from its pool # as soon as the service is 0/0. If you do not set that, fallback to dynamic-config.yml file usage. - traefik.docker.lbswarm=true - traefik.http.middlewares.ondemand_whoami.plugin.traefik-ondemand-plugin.name=TRAEFIK_HACKATHON_whoami - traefik.http.middlewares.ondemand_whoami.plugin.traefik-ondemand-plugin.serviceurl=http://ondemand:10000 - traefik.http.middlewares.ondemand_whoami.plugin.traefik-ondemand-plugin.timeout=1m - traefik.http.routers.whoami.middlewares=ondemand_whoami@docker - traefik.http.routers.whoami.rule=PathPrefix(`/whoami`) - traefik.http.services.whoami.loadbalancer.server.port=80 nginx: image: nginx healthcheck: test: "true" interval: 1m30s timeout: 30s retries: 5 start_period: 30s deploy: replicas: 0 labels: - traefik.enable=true # If you do not use the swarm load balancer, traefik will evict the service from its pool # as soon as the service is 0/0. If you do not set that, fallback to dynamic-config.yml file usage. - traefik.docker.lbswarm=true - traefik.http.middlewares.ondemand_nginx.plugin.traefik-ondemand-plugin.name=TRAEFIK_HACKATHON_nginx - traefik.http.middlewares.ondemand_nginx.plugin.traefik-ondemand-plugin.serviceurl=http://ondemand:10000 - traefik.http.middlewares.ondemand_nginx.plugin.traefik-ondemand-plugin.timeout=5m - traefik.http.middlewares.ondemand_nginx.plugin.traefik-ondemand-plugin.waitui=false - traefik.http.routers.nginx.middlewares=ondemand_nginx@docker - traefik.http.routers.nginx.rule=PathPrefix(`/nginx`) - traefik.http.services.nginx.loadbalancer.server.port=80