Can't connect to consul in dev mode without network_mode: host


I’m using consul in docker-compose, which looks like this. Before, I created my own network:
docker network create -d bridge --subnet mynetwork

    image: consul:1.8.0-beta2
    container_name: containerConsul
    network_mode: mynetwork
    command: [

    image: <someimage>
    container_name: containerMS
    network_mode: mynetwork

this is ms_auth - nodejs app

import * as consul from 'consul';

  const consulApp = consul({
    host: 'containerConsul',
    port: 8000,

  consulApp.catalog.node.list((err, result) => {
    // Here I have an error

Error: connect ECONNREFUSED
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) {
      errno: -111,
      code: 'ECONNREFUSED',
      syscall: 'connect',
      address: '',
      port: 8000

But when I’m changing network_mode: to host for both consul and my app, everything is working as expected. Could you please help me what to do to work consul with ms in one network without host mode