Hi Swans! I’m Zbigniew, and I joined Sylius in March this year. I took the responsibility to dockerize not only the Sylius Platform but also the Sylius Community and Sylius Development Team. I would like to share the long and short-term plan that will affect current docker-related files in Sylius. These changes may be radical but we will provide a much better experience from scratch, and most importantly, you will be able to support me through this journey.
Personal Goal: Let’s make Docker inside Sylius-Standard work out of the box.
The most annoying part of Sylius-Standard for me, as a newcomer, was that the template project contained Docker that did not work. I wanted to test Sylius locally, but I couldn’t do it!
And so, I spent a lot of time fixing and improving the current Docker solution in small incremental changes. I can proudly say that it is DONE. Both docker-compose.yml and docker-compose.prod.yml configs are working out of the box.
You can see the docker-related pull requests here. What’s left to do is to create testing pipelines to ensure each change preserves the accountability of the Sylius Dockerized environment. For now, we only test if the image builds successfully on linux/amd64 and linux/arm64 architectures. With that, we are sure our Apple Silicone users’ experience is fine.
With the fixed Sylius-Standard Docker, I can finally make cleanups. I would like to take care of the old docker repositories. The following repositories will be archived soon:
The reason for that is lack of documentation, contributors, and overall plan.
I created a new place that’s called Sylius-Docker-Standard. Additionally, Sylius will be used internally, which is great because we will eat our dog’s food. If you encounter problems during deployment, they will literally affect Sylius as well..
Sylius-Docker-Standard will be simpler because we will change its target to beginner-friendly. What I’ve noticed is that most of the Sylius Community Experts use their own variations of docker for Sylius or have even created their particular solutions. That’s so cool! ❤️ We could even link them as examples for more advanced members.
Our images are available via Docker Hub Registry.
The most significant difference between now and then is a plan for how and what to do with Sylius and Docker.
For starters, let me tell you about two types of images. First is the headless image for everyone that uses Sylius via API only. The second one is the traditional image with both front and back end. Currently, there is an all-in-one Ubuntu-based image. It is simple and based on a Linux distribution that most developers are familiar with. It has one big disadvantage though – size. Ubuntu Linux adds almost 27 MB to the image size, whereas Alpine Linux – only 3 MB. That’s why the next step is to create an Alpine-based image.
There are many ways to deploy Sylius, but let’s be honest – you probably want to SCALE! You can do it either vertically or horizontally. A vertical scale is cool, but you have to do it manually, so downtime may occur. The best practice is to scale horizontally via Kubernetes Cluster or Docker Swarm. Feel free to ask us for assistance!
Have you heard about the Roadrunner project? Well, we’re going to test its performance against the classic php-fpm and nginx combo. Besides that, Roadrunner is written in golang; it does not require a reverse proxy like Nginx. Therefore, it minimizes the number of containers to just one.
I hope that with PHP 8.1 and fibers, PHP Community is going to get closer to its process manager without the required reverse proxy.