title: Why does mongo crash inside of docker at random?
body: <p><em>I have a docker-compose file that creates a Nodejs app that depends on mongo that is on another docker.</em></p>
  <p><strong>The compose runs properly but than at random I get the following error, why do I get this ?</strong></p>
  <pre><code>{&quot;level&quot;:&quot;error&quot;,&quot;type&quot;:&quot;none&quot;,&quot;message&quot;:&quot;Error: MongooseServerSelectionError: getaddrinfo EAI_AGAIN mongo&quot;,&quot;service&quot;:&quot;portal&quot;,&quot;timestamp&quot;:&quot;21-03-21 01:54:24&quot;}
  </code></pre>
  <p>the docker-compose file</p>
  <pre><code>version: &quot;3.2&quot;
  
  services:
    portal:
      container_name: portal
      image: keybraker/portal:latest
      build:
        context: .
        dockerfile: ./docker/Dockerfile
      depends_on:
        - mongo
      volumes:
        - type: bind
          source: ../logs
          target: /logs
  
    mongo:
      container_name: mongo
      restart: always
      image: mongo:4.4.3
      ports:
        - &quot;29017:27017&quot;
      volumes:
        - type: bind
          source: ../mongo/data/db
          target: /data/db
  </code></pre>