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 ?

  • How to check if docker is running or not
  • Limit JVM memory consumption in a Docker container
  • Shared volume within multiple docker containers
  • ASP.NET Core 1.0 EF7 System.Data.SqlClient not found
  • Docker for mac 1.12.0: how to connect to host from container
  • How to specify --dns entry in docker swarm
  • Docker images wont run in background
  • Multi command with docker in a script
  • MobileFirst Runtime “Disappearing” in Bluemix Container
  • Docker container exits on non-zero exit status
  • Docker-compose: Encountered errors while bringing up the project
  • Docker access localhost
  • 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.