When I board-on new clients I usually need a docker environment. It used to be aligned with Magento 1 and 2. Now, I moved on and said Goodbye to focus for Magento 1 and 2 clients and now I am working much more with Symfony. That said, new clients usually get a Symfony-based solution. And because of that, I need an individual docker environment everytime a new client hops on. My demand for my server playground is one that will match the server. Especially for Symfony, this is quite relevant sometimes, especially when you want to run a specific set of commands via the make bundle. MariaDB has some troubles in correctly handeling all these things, compared to MySQL.

So we have several things that must be aligned here:
  1. Webserver
  2. PHP Version (8.2 for example)
  3. MySQL/MariaDB

So I can setup an easy Docker container environment with that. But its not done in a minute. In any case it takes time. Time the customer does not want to pay - and here, the client is right. This is a repetitive task and it should be super fast, and not so much repetitive. The time it takes to get a basic setup for Docker is still nothing compared to configure the whole machine to the individual PHP versions, but it should be fast, easy and only a matter of a minute or two. Right not it takes at least an hour to get it aligned with the server and the available modules. In any case, working on your machine directly on clients code is the worst option you can choose.

Not just it creates "works on my machine" situations, it also limits you to one client at a time, as most webhosters do not all have the exact same version of PHP, and also you cannot simply give your code to a colleague. Collaborative work is impossible without containerization. Last but not least security - having a limited set of software inside your image allows you to test gradually for exploits when they are getting used in the wild, and fixing them does not become a game with fire where you have to play on Production. You can test it safely in your image, then apply it without problems to Production. Everything just gets much easier with the use of Docker.

For that reason I have created a script, called "Super Simple Symfony Docker Creator" on GitHub. It will allow you to spawn a Docker container with Symfony files included in one single command line. Thats right! One command line and you are presented with an ready-to-use Docker + PHP + Nginx/Apache + MySQL/MariaDB + Symfony Project directory. It virtually cannot get any easier than this. 

Its also super easy to get. You can just run these commands to get a copy of it into your bin folder:

shell
curl -O https://raw.githubusercontent.com/nopenopenope/super-simple-symfony-docker-creator/master/sssdc.sh
chmod +x sssdc.sh
mv sssdc.sh /usr/local/bin/symfony-docker-creator

Now, all you have to do is to go to your target folder where you want to spawn the containers and run this CLI line:

shell
symfony-docker-creator --webserver nginx:1.25.3-alpine --php php:8.3-fpm --port 5555

It will create a SSL-enabled Nginx Server for you, together with PHP, that runs on Port 5555. And since everything is in place, modification is now also much easier for beginners. Check it out and feel free to give it a star if you could use it!