Reputation: 111
I have an Ubuntu 16.04 droplet running on Digital Ocean. I am running MongoDB 3.2.10 as a service, and dokku 0.7.2 running a node.js application.
How can I connect to the MongoDB service running on the host outside the app container? I would like to do this without exposing the MongoDB service publicly if possible.
Upvotes: 0
Views: 958
Reputation: 11
Your best bet in my opinion would be to setup a Private IP on your mongoDB Droplet and Your Dokku host and do some routing or port forwarding from the dokku host to the mongoDB Host.
Ideally though you could backup the mongoDB and restore it to a dokku managed mongo instance.
Install the Plugin
# dokku plugin:install https://github.com/dokku/dokku-mongo
Import your DB
# dokku mongo:import database < database.dump.tar
Link to your App
# dokku mongo:link app database
Upvotes: 1