I read the article “Setting Up a Modern PHP Development Environment with Docker” (https://www.sitepoint.com/docker-php-development-environment/) with interest, but it provided no way to post comments. Hence, only the opinions of the author were reflected in this tutorial.
I wanted to give an opposing point of view as a web developer with 26 years of experience. I will write it here in the hope that it will prompt either adding this text to the article, or at least adding some balance to the article.
I have been operating a local Windows 10 development webserver for many years, and most of my web programming has been in PHP. I use a WAMP environment (from Bitnami) with only one major issue: migrating to new versions of the WAMP components takes several hours of work. For this reason, I upgrade versions about once every three years. I have not found different component versions between local and remote webservers to be much of an issue, as each new version of PHP, etc., mostly introduces new features that I rarely use while rarely deprecating or eliminating features that I use.
I have no intention of ever using my local webserver for production use. But if I wanted to, the changes required would take under an hour to do, and would mostly consist of making the site available on the Internet. I have actually done this as an experiment and my websites worked fine when visited from other computers.
While I understand the philosophy of Docker as providing a virtual container for a website, so that the website will run anywhere without change, I would like to make the following points in opposition to this approach:
-
Docker must have considerable space and time overhead to provide its service. Even with low prices for secondary storage, keeping such overhead low helps with responsiveness, file copying speed, the freedom to store lots of videos on the server, and other perhaps more subtle issues. Docker must provide a “prune” command to help the user clean up from its free use of drive space. I see that the actual space and time overhead for Docker is not admitted in this article or others that advocate the use of Docker. Unfortunately, I’m too busy to install Docker and measure these for myself.
-
I don’t need what Docker provides: through years of experience I can easily create websites and web programs (including new website development tools) that are intrinsically portable between various kinds of webservers. I develop on Windows using several different web technologies and run on Linux (Centos) remotely, under WHM/cPanel, in a VPS. The idea that there are great differences between these environments calling for virtualization is not true, in my opinion.
-
I need my development websites to run differently from production websites, irrespective of OS. Principally, I need better security for production websites, so there must be less details in error reporting. All such differences are governed by the definition of an environment variable on the dev website that does not exist on the prod website. Simple.
-
Docker is certainly more efficient than traditional hardware virtualization products using a hypervisor, but this is not the central issue in website and/or database development. I can’t envision needing OS virtualization, ever, for my own website development work.
Respectfully submitted,
David Spector