version: '3' services: traefik: image: traefik:v1.7 command: --web \ --docker \ --docker.swarmmode ports: # The HTTP port - "80:80" # The Web UI (enabled by --api.insecure=true) - "8080:8080" volumes: # So that Traefik can listen to the Docker events - /var/run/docker.sock:/var/run/docker.sock networks: - net deploy: placement: constraints: [node.role==manager] whoami: # A container that exposes an API to show its IP address image: containous/whoami deploy: labels: - "traefik.enable=true" - "traefik.backend=whoami" - "traefik.docker.network=net" - "traefik.port=80" - "traefik.frontend.rule=Host:whoami.docker.local" #- "traefik.backend.loadbalancer.sticky=true" networks: - net networks: net: