title: Traefik with docker-compose creates too many frontends
body: <p>I want to use multiple docker-compose projects with Traefik as reverse proxy. After following the documentation I've created two docker-compose files; one for Traefik and one for an example project which has 2 "whoami" containers. </p>
  
  <p>This works great for the backends, but it seems that Traefik creates one frontend per running container. So instead of 1 frontend for the 2 whoami containers, I got two frontends defined: "frontend-Host-whoami-localhost-0" and "frontend-Host-whoami-localhost-1".</p>
  
  <p>Traefik will create more frontends if I scale up the whoami service (by either duplicating their definition in the docker-compose.yaml file, or with <code>docker-compose scale whoami=10</code>).</p>
  
  <p>I just want one frontend for the "Host:whoami.localhost" rule, which points to one backend with multiple running containers attached to it. How can I do this?</p>
  
  <p>traefik.toml:</p>
  
  <pre><code>defaultEntryPoints = ["http"]
  
  [web]
  address = ":8080"
  
  [entryPoints]
      [entryPoints.http]
      address = ":80"
  
  [docker]
  endpoint = "unix:///var/run/docker.sock"
  domain = "localhost"
  </code></pre>
  
  <p>docker-compose.yaml (for traefik):</p>
  
  <pre><code>version: "2"
  services:
    traefik:
      container_name: traefik
      image: traefik
      networks:
        - webgateway
      ports:
        - "80:80"
        - "8080:8080"
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
        - ./traefik.toml:/traefik.toml
      labels:
        traefik.backend: web
        traefik.frontend.rule: Host:monitor.localhost
  
  networks:
    webgateway:
      driver: bridge
  </code></pre>
  
  <p>whoami/docker-compose.yaml:</p>
  
  <pre><code>version: "2"
  services:
    whoami:
      image: emilevauge/whoami
      networks:
        - webgateway
      labels:
        traefik.backend: whoami
        traefik.frontend.rule: Host:whoami.localhost
  
    whoami_2:
      image: emilevauge/whoami
      networks:
        - webgateway
      labels:
        traefik.backend: whoami
        traefik.frontend.rule: Host:whoami.localhost
  
  networks:
    webgateway:
      external:
        name: traefikdocker_webgateway
  </code></pre>