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:
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
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.
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.
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.