I am trying to deploy a Node.js app with mongodb on digital ocean with dokku. Unfortunately, I have some problems having the node app connecting to mongodb.
What have I done so far. 0. I have a node.js app in a git repo 1. Created dokku instance in digital ocean (runs on ubuntu 14.04) 2. I created a dokku-mongodb-plugin (see https://github.com/jeffutter/dokku-mongodb-plugin): follow the git clone etc installation instructions over there. 3. push my app to the digital ocean server (git push -u production master) 4. try to create a mongodb process: (on server): dokku mongodb:create testapp (testapp is the name of my app) 5. run my app: dokku run testapp node app.js
This leads to a connection error (at the bottom)
I have tested: dokku mongodb:list
and it does not return anything, which makes me think there might be an issue with the plugin?
Otherwise, I suspect it might be due to mongodb running under a different ip / process than the standard localhost.
Anyway, I am not really sure what the problem is. Any help would be appreciated.
Cheers, Mike
vents.js:72 throw er; // Unhandled 'error' event ^ Error: failed to connect to [localhost:27017] at null. (/app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:546:74) at emit (events.js:106:17) at null. (/app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:150:15) at emit (events.js:98:17) at Socket. (/app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:533:10) at Socket.emit (events.js:95:17) at net.js:440:14 at process._tickCallback (node.js:419:13)