Productionizing a running container
So far in this chapter, we've learned how to get containers up and running, and even how to build or customize container images. But in the previous recipe, I noted that you wouldn't actually want to run MongoDB in production in the way that I described. You may be wondering, why is that?
There are a few reasons. Firstly, containers are, by design, ephemeral – this means every time you restart a container, it's back to the state it was originally in. This is probably fine for something like a web server – but it's not fine for a database server. Imagine losing all your data every time you restarted your server! Secondly, we're not passing any configuration through to our containers. A lot of containers are designed to run with just ephemeral storage. This is not persistent, so how do we configure the software inside the container? There are other things we have to figure out if we're going to keep our...