Can't connect to mongodb in the docker container Can't connect to mongodb in the docker container mongodb mongodb

Can't connect to mongodb in the docker container


Use host.docker.internal with exposed port : host.docker.internal:27017


Using localhost instead of the ip, allows the connection.

Combine it with the exposed port: localhost:27017

I tested the solution as it was stated in the comments, and it works.