Create new MongoDB instance based on existing data

i want to dockerize my production application. I’ve got MongoDB set up on server and I want to remove it, and make a docker container with MongoDB which will work on existing data. I already tested this approach, so i created a docker container which storage is pointed to host storage with existing data. Basically it’s the new MongoDB instance which work on data created by previous mongoDB which existed on Host. And it works, so i can query data, my application can connect to this database and so on. My question is, what are the threats to this approach? And if this is even good approach, or when i created new mongoDB instance should i import dump data from previous one ?

  • Cleaning half-downloaded docker image
  • Custom Container for hosting OpenLDAP in Bluemix
  • Private Docker Registry Not Connectible to Shell & Web Management UI?
  • Docker registry: Can't find image
  • Mean Stack Application Deployment Using Docker Failed
  • Setup local WordPress development environment with Docker error 500
  • docker login returns a 404 for artifactory
  • How to specify Memory & CPU limit in docker compose version 3
  • What is root cgroup process behavior on Debian?
  • docker-compose on windows directory sync
  • dockerized HAProxy+Keepalived for HA
  • Unable to ssh to master node in mesos local cluster installed system
  • One Solution collect form web for “Create new MongoDB instance based on existing data”

    I guess there’s no right and wrong in this case. It depends on how you want to have it working.

    Let’s say you left Mongodb running in the cloud.

    Is it a development database? If yes, how would you keep coding / testing without access to that?

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.