I am new to docker. I built one application to run in docker. I am running the application in 192.168.99.100:8088
docker machine IP address. But I am unable to connect with MongoDB of my local system db.
In my application I gave mongodb
path like this:
MONGODB_URI=mongodb://192.168.1.88:27017/sampledb (192.168.1.88is my system ip address it is not static)
App_PORT = 8088
I want to access my system database (I'm using the database named as pmsdb
) I want to access that db with the sample application in docker
.
I dont know how to connect mongodb
database into that docker
. Which path should I give also I don't know. Because When I run the application in my system I will use mongodb path="monogdb://localhost:27017/sampledb
If I use the same path in docker built application It is not working.
Using docker -machine ip address 192.168.99.100:8088
I am running my project. But my system database(sampledb) which ip address I should give?
How to connect my mongo db with docker container (samplenodejs)
Now How to connect my local db into samplenodejs application which is running in docker.
Mongodb version :3.4.2
ip address of mongodb: 127.0.0.1:27017