Developing apps with docker

Bind mounts / Volume

We know that each container is based on an image and that container if destroyed all the content on it will be gone. There are 3 ways of preserving / sharing files between containers and those are: Bind mount, Volume and tmpfs mount.

Image #1. Shared storage

Docker compose

Now that we know this, we are going to use the Volume as a good practice to follow while developing with containers. For this we are going to use docker-composer and our example app is based in a nodejs application and also uses a mongo DB that is shared in another location.

Image #2. docker-compose.yml
Image #3. Compiling docker compose
Image #4. Changing the code
Image #5. Tailing logs

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Josué Carvajal

Josué Carvajal

Sr. Security software engineer working in the DevSecOps area. CompTIA Sec+, C|EH