I am running local mongodb on Ubuntu, all latest. Connecting from a regular local application is fine. However when I am running a java application in docker container locally, the same app does not connect. Tried using host.docker.internal - this is not regognized. Tried to use actual local IP as 192.168.1.100 or docker specific local IP as 172.17.0.1 both are recognised, however getting connection refused. Java exception is:
exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}
Is there any specific configuration in local mongodb that might prevent accepting this connection? I am assuming the port should not change from default being 27017
I did not realize local docker has its own IP address, thanks for the hint. Figured out it is 172.17.0.2
However I am now not sure where the heck local mongodb has its configuration. Mongo is very much quiet about anything that is not Atlas - any queries in google give everything about Atlas but almost no documentation about local deployment. So where is that configuration for local?