Dockerhero

Published on 27-12-2019 Latest update on 10-01-2020

Dockerhero is a local development tool. Out of the box, it should only take a "docker-compose start" to get all your local PHP projects working. Yes, all of them. At the same time.

The OG Setup

A long time ago the developers at the company where I worked at the time were responsible for setting up their own development environments. So each developer had his own laptop, their own prefered OS they were used to and were running the software of their choosing to work on the projects. So for example, someone was using Windows with XAMPP, another one was using PHP with Apache on Ubuntu and someone else was using MacOS with I don't know what piece of server software.

This was all fine until we ran into some issues. We had errors on production that we were unable to reproduce locally because all of the environments were different and no one was running the exact same setup as our production environments.

The first solution

So during my free time I went on a search for a solution. I came across Vagrant and a tool called PuPHPet. I spent some time researching those and made a config that mirrored our production environment and tried it out. Everything worked flawlessly. The first time setup and updating the system was very slow, but it worked. And it kept working for a year or two.

Until certain packages were not available anymore or versions became deprecated, or were not up-2-date yet. I had to hack the config files way to much it felt like duct tape on top of duct tape. And if someone re-installed his development environment, things might just not work anymore because packages might have been removed from the registry.

So we came full circle again and had a local environment that did not match the production environment.

But it was still better than before because at least everyone ran the same setup.

Introducing: Dockerhero

Again, I spent some weekends looking for a different solution and stumbled upon Docker and Docker Compose and managed to get something up and running that was easy to update, stable, very fast to set up and update. For my company I could simply use an override file to override any changes to the default setup if needed.

I added a way to add custom, per project, vhost configuration, created documentation, and made the repo public.

After using it myself for a few weeks I felt confident enough to introduce it to the company. And so far there have not been any issues. Everything just works. If we update our PHP version, I just create a new PHP image and either make it part of the core setup or we use the override file to use the new version.

An added bonus was that I could use a lot of the configuration code to create a Docker image for CI builds and code quality checks.

Visit the project

Avatar

About Me

I am a full-stack developer (for some reason full-stack developers are called Unicorns...) from the Netherlands and started programming when I was 12 years old. The first programming language I learned was Visual Basic. I have always loved bringing my thoughts and ideas to the computer screen.

After finishing high school I knew that I wanted to make my living by programming. So I choose an "Application Development" study. When I completed my internship, I started working full-time making websites and web applications. The language I was writing in at the time was ASP Classic.

ASP Classic; however, was quickly overshadowed by PHP and I decided to switch to that programming language instead. In the beginning I was making my own "mini frameworks" for projects I was working on, but quickly switched to CodeIgniter.

Luckily, after a few months, I discovered a framework called Laravel. And up until this day I still use Laravel as my PHP framework of choice. It just gives you so much features out of the box, it becomes trivial to quickly set up a proof-of-concept. And is also powerful and flexible enough to transform that proof-of-concept in a future-proof, stable and secure application.