title: Docker containers on same host listening to the same 2 ports
body: <p>I am trying to make different Python scripts running on different containers , configured with docker compose able to listen to the same ports. Each of this containers (that are 9) should listen to port 1883 and 8086. The idea is to write a docker-compose file in which each service have these characteristics:</p>
  <pre><code>  sensor1:
      build: ./sensor1
      image: sensor1:latest
      ports:
       - &quot;8086:80&quot;
       - &quot;1883:80&quot;
  ....
  ....
    sensor9:
      build: ./sensor9
      image: sensor9:latest
      ports:
       - &quot;8086:80&quot;
       - &quot;1883:80&quot;
  </code></pre>
  <p>I know that with a normal docker compose file it doesn't work and I need a reverse proxy, but I am stuck on this reverse proxy(i.e. Traefik) configuration. Practically these scripts should listen to port 1883 receiving from a external broker and write on a database positioned in the same host that can be accessed using port 8086</p>