Docker and Docker-Compose: My Favourite Benefit

I’ve recently started using docker and docker-compose to deploy web applications. There is one key benefit that has blown me away.

A Bit About My Life Pre-Docker

I’m a full stack developer, which means that I am familiar with all of the technologies needed to run a website. The group of specific technologies used in a project are known as a technology stack, here is my typical technology stack:

 

  • JavaScript/jQuery
  • HTML
  • CSS
  • Python
  • Flask
  • Django
  • Git
  • MySQL/PostgreSQL/SQLite
  • MongoDB
  • Nginx
  • Gunicorn
  • AWS

To be an effective web developer, I need to get better at all of these technologies. 

The absolute best way to get better at something it to practice

The absolute best way to get better at something it to practice. When it comes to improving my skills on this technology stack, practice means making websites. As I build a website, I am practising these technologies. I might spend a day focussing mainly on Django, or a day focussing on mainly JavaScript, HTML, and CSS. But over the process of building a website, I will have spent a good amount of time on most of the technologies. 

That means I will get progressively better at most of the technologies. 

But I never spent that much time with gunicorn or nginx.

Let me tell you why. 

The Problem

Nginx and gunicorn are technologies that are used to direct web traffic to the website and to run the website. During development, I don’t need these technolgies because the website isn't live yet. I can run the website in a simper way on my laptop, and it works fine for development. 

So for each project, I was maybe spending a few hours with these technologies at the end of a project when putting the website live. The result? I never really got good at them, and I never really learnt them properly. 

 

This always bothered me. I knew it was important to get to know every technology in my stack, and I was aware that my knowledge of gunicorn and nginx was lagging behind the other parts of my stack, and they were never going to catch up. I simply didn't spend enough time with the tech. 

That’s changed now.

Docker and Docker-Compose

With docker and docker compose, my development environment is almost the same as my production environment. 

Now, when I am developing a website, I use nginx and gunicorn to run the website. It’s like I’m running a proper server on my laptop. That means that I am using nginx and gunicorn all the time. I’m not using them for a few hours as an afterthought at the end of a project. Now, one of the first things I do when I start a new project is to configure nginx and gunicorn. And I run them throughout development.  

This means the hours I spend with nginx and gunicorn are going to go up a lot quicker than before. And hours spent with a technology means I will get better at these technologies. 

Massive Relief

This is a massive relief to me. Using Docker and Docker-Compose means that I am going to spend a lot more time working with the full range of technologies I need to know to be an effective web developer. 

That time spent working with the full technology stack means that I will get better at the technologies I need to improve on, and I will become a more competent and fully rounded we developer. 

That, to me, is the biggest benefit of Docker and Docker-Compose.

Read next