Category: Database, Data, Docker, yaml

In part I of this series, we learned about creating Docker images using a Dockerfile, tagging our images and managing images. Next we took a look at running containers, publishing ports, and running containers in detached mode.

First, we’ll take a look at running a database in a container and how we use volumes and networking to persist our data and allow our application to talk with the database.

Before we run MongoDB in a container, we want to create a couple of volumes that Docker can manage to store our persistent data and configuration.

We are also mapping our local source code into the running container so that we can make changes in our text editor and have those changes picked up in the container.

Related Articles