Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dockerized MongoDB on Heroku?

I'm not sure if this is the right StackExchange to be asking this, but I'm in the process of setting up a MEAN stack application and I want to do it right from the get-go.

I really would like to use Docker and Heroku (due to their new pipelining groups and ease of deployment as the sole developer), but I can't find any guides on how to run MongoDB as a docker image on Heroku.

Is this even possible? I also don't really understand how you can put a database into a binary image (Docker image) anyways, yet every guide I've read says to separate the micro-services.

Has anyone else done this?

Thanks.

EDIT: Or is it just a better idea to leave Mongo undockerized and use MongoLabs and have two separate instances for Dev/Prod databases?

like image 266
carbon_ghost Avatar asked Jul 25 '16 19:07

carbon_ghost


1 Answers

There is an official mongodb docker image which you can use. you just need to make sure you have docker installed on heroku.

If you are concerned about the data persistance you can easily mount host directories into your container so you will have physical access to your data. if you are worried about accebility you can easily expose ports inside your comtainer to your host so everything can connect to it.

Having your database in a container makes you able to be worried only on the db configuration and not the ehole stack . so when something goes down you always know where to look.

like image 144
Miad Abrin Avatar answered Oct 04 '22 03:10

Miad Abrin