I have been running Docker containers on my home lab for a while now. From my DNS server to my Jellyfin media server, many of my applications run on Docker. But configuring Docker settings through the Linux command prompt is confusing and often frustrating, or it was. That’s when I discovered Docker Compose, a much more efficient way to manage my container.
Docker Compose has a much more structured format, similar to many coding languages. You can lay out different variables such as port numbers, directories for the container to use, and anything else a container might require, and this can all be changed through a file editor such as nano. Another great thing about Docker compose is the ability to stack multiple Docker containers into one file. This is great in terms of efficiency, as you can simply deploy and tear down the one compose file rather than dealing with each container separately.
I recently completed a home lab project using compose where I created a container called gluetun. This container routes traffic through a VPN. In the same compose file I added 3 containers that I wanted to have ran through the VPN. I simply configured the network mode to rely on the gluetun container and now with the push of a button, all my applications are deployed and in sync.