I am very new to Docker and I'm struggling with a configuration. My current configuration is that I have multiple Node/Express microservices on my local system which are using nodemon. All of these connect to mongodb running on mongodb://localhost:27017/localv2.
I'm trying to dockerize all my microservices. The issue is that they are not able to connect to mongodb on localhost:27017. I have 2 questions:
Why are they not able to connect to localhost:27017?
How to make them connect to the current running mongodb in my system?