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