arunoda / meteor-up-legacy

Production Quality Meteor Deployments
MIT License
2.26k stars 395 forks source link

Multiple apps using same Mongo database #966

Open tobias-f opened 8 years ago

tobias-f commented 8 years ago

Hello.

I have a quick question: is it possible to use the same Mongo database from different apps deployed via meteor up? A simple example: I have application ToDo. In the mup.json I configure

  "setupMongo": true,
  "appName": "todo"

and no MONGO_URL.

After deployment I have two docker containers running on the server (one called todo, the other one called mongodb). In the mongodb I have a database todo containing the collections of the todo app.

Now I want to have an admin interface for the todo app. This is a different meteor application called todo-admin. I want the todo-admin app to have access to the todo app database. Without mupx I would just install MongoDB on the server and startup both with application with the MONGO_URL. But how do I achieve this with mupx, considering that mongodb runs in a container and automatically creates a database with the name of my app?

Thanks a lot for any hints how to do that.

Cheers,

Tobias

MasterJames commented 8 years ago

You can set the second configuration settings to be false for setting up Mongo and use the mongo_url for the second one to point to the first one. People might choose to setup the database separately and then point both of them too that. If your not aware you might want to try the port in progress over at kadirahq/meteor-up as this version will be depreciated by it (soon if not already for most).