0

I have a docker-compose file that creates a Nodejs app that depends on mongo that is on another docker.

The compose runs properly but than at random I get the following error, why do I get this ?

{"level":"error","type":"none","message":"Error: MongooseServerSelectionError: getaddrinfo EAI_AGAIN mongo","service":"portal","timestamp":"21-03-21 01:54:24"}

the docker-compose file

version: "3.2"

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:
      - "29017:27017"
    volumes:
      - type: bind
        source: ../mongo/data/db
        target: /data/db
  • Take a look at [this question](https://stackoverflow.com/questions/40182121/whats-the-source-of-error-getaddrinfo-eai-again), probably it's an answer which you are looking for. – AlexZeDim Mar 21 '21 at 09:08
  • although https://stackoverflow.com/questions/40182121/whats-the-source-of-error-getaddrinfo-eai-again is probably the reason of this error. There is no definite answer to this problem. – MeLeneKouvela Mar 21 '21 at 09:23
  • @AlexZeDim there is no solution there – MeLeneKouvela Mar 21 '21 at 11:33

0 Answers0