title: Traefik as a proxy for Docker container with host machines network
body: <p>I would like to set up the following scenario:</p>
  
  <ul>
  <li>One physical machine with Docker containers</li>
  <li>traefik in a container with network <code>backend</code></li>
  <li>another container which is using the host machines network (<code>network_mode: host</code>)</li>
  </ul>
  
  <p>Traefik successfully finds the container and adds it with the IP address <code>127.0.0.1</code> which obviously not accessible from the traefik container (different network/bridge).</p>
  
  <p>docker-compose.yml:</p>
  
  <pre><code>version: '3'
  services:
      traefik:
          image: traefik
          ports:
              - "80:80"
              - "443:443"
          volumes:
              - /var/run/docker.sock:/var/run/docker.sock
              - ./traefik.toml:/etc/traefik/traefik.toml
          networks:
              - backend
       app:
           image: my_app
           labels:
               - "traefik.enable=true"
               - "traefik.frontend.rule=Host:myapp.example"
               - "traefik.port=8080"
           network_mode: host
  networks:
      backend:
          driver: bridge
  </code></pre>
  
  <p>The <code>app</code> container is added with </p>
  
  <pre><code>Server      URL                     Weight 
  server-app  http://127.0.0.1:8080   0
  Load Balancer: wrr
  </code></pre>
  
  <p>Of course I can access <code>app</code> with <code>http://127.0.0.1:8080</code> on the host machine or with <code>http://$HOST_IP:8080</code> from the traefik container.</p>
  
  <p>Can I somehow convince traefik to use another IP for the container?</p>
  
  <p>Thanks!</p>