title: Containers are not accessible to each other
body: <p>I have had the problem since the beginning that I can not connect between two containers.</p>
  
  <p>I have read and adjusted all available tutorials, but as it is presented in all these tutorials, it does not work for me.</p>
  
  <p>I get from my app always the message that the connection was thrown back, no matter what kind of server I use. I tried it first with Redis as a cache service, then me the Mongo DB but always I get the message that the connection could not be made.</p>
  
  <p>I'm new to the topic, could you help me with troubleshooting?</p>
  
  <p>This is my docker-compose.yml</p>
  
  <p>version: '3.2'
  services:</p>
  
  <pre><code>  core:
      container_name: 'core'
      build: ./core/
      ports:
        - '8000:3000'
      environment:
        NODE_ENV: 'production'
        NODE_PORT: '3000'
        CORE_HOST: 'core'
        CORE_PORT: '8000'
        CONTACTS_HOST: 'contacts'
        CONTACTS_PORT: '8100'
        MONGO_URI: 'mongodb://db:27017'
      restart: always
  
    contacts:
      container_name: 'contacts'
      build: ./contacts/
      ports:
        - '8100:3100'
      environment:
        NODE_ENV: 'production'
        NODE_PORT: '3100'
        CORE_HOST: 'core'
        CORE_PORT: '8000'
        CONTACTS_HOST: 'contacts'
        CONTACTS_PORT: '8100'
        MONGO_URI: 'mongodb://db:27017'
      restart: always
  </code></pre>
  
  <p>and these are the two Dockerfiles</p>
  
  <pre><code>FROM node:9.6.0-alpine
  RUN mkdir -p /usr/src &amp;&amp; mkdir -p /usr/src/core
  WORKDIR /usr/src/core
  COPY . /usr/src/core
  EXPOSE 3000
  CMD npm install &amp;&amp; npm run start
  
  
  
  FROM node:9.6.0-alpine
  RUN mkdir -p /usr/src &amp;&amp; mkdir -p /usr/src/contacts
  WORKDIR /usr/src/contacts
  COPY . /usr/src/contacts
  EXPOSE 3100
  CMD npm install &amp;&amp; npm run start
  </code></pre>