title: Docker compose networking between pods
body: <p>I have a docker compose file which starts up RabbitMQ.  It works fine rabbit starts and from my machine i am able to see the rabit ui http://localhost:15672/#/queues.</p>
  <p>I have been using this rabbit for another project.</p>
  <pre><code>version: &quot;3.2&quot;
  services:
    rabbitmq:
      image: rabbitmq:3-management
      container_name: 'rabbitmq'
      restart: always
      ports:
          - 5672:5672
          - 15672:15672
      volumes:
          - ~/.docker-conf/rabbitmq/data/:/var/lib/rabbitmq/
          - ~/.docker-conf/rabbitmq/log/:/var/log/rabbitmq
      networks:
          - rabbitmq_go_net
  
  networks:
    rabbitmq_go_net:
      driver: bridge
  </code></pre>
  <p>Now I have a new project.  Which also needs to access RabbitMQ.</p>
  <p>I have created a new docker compose file for this project and im trying to get it to connect to the rabbit container that is running.</p>
  <pre><code>version: '3.4'
  
  services:
    pub:
      image: &quot;myapp_debug:latest&quot;
      container_name: 'pub'
      restart: always
      ports:
          - 9090:9090
          - 15673:15673
      environment:
        - ASPNETCORE_ENVIRONMENT=Test
        - ASPNETCORE_URLS=http://+:9090
      volumes:
        - &quot;C:/Development/hold1/mnt:/mnt&quot;
      networks:
          - rabbitmq_go_net
  
  networks:
    rabbitmq_go_net:
      driver: bridge
  </code></pre>
  <p>Its not working its not able to connect to rabbit.  I suspect it has something to do with the host being localhost.  Do i need to set up some kind of routing so that it connects to the other pod?</p>
  <p>Yes i know i could probably combine these into a single docker compose file but that is not the exercise here.  I am just trying to get them to talk.</p>
  <p>Unless of course the issue is that they have to be in the same docker compose file to be able to communicate.</p>