This page collects all articles that have been published in my tutorial series on developing PHP on Docker. You can find all code samples in the "Docker PHP Tutorial" repository on Github. If you want to follow along when new articles are being published, I'd recommend to
FYI: Some tutorials provide a video with additional information. There is a YouTube playlist available containing all those videos.
A primer on Docker. What is Docker? How to install it / transition from Vagrant? How to interact with containers? How to organize multiple services (php-cli, php-fpm, nginx) via docker-compose?
Using docker for Development. How to configure PhpStorm to play nicely with Docker? How to setup Xdebug (including the solution for the dreaded 'Connection with Xdebug was not established.' error)?
Running a battle-tested development infrastructure for PHP developers in Docker. How to organize the
docker folder structure (e.g. shared scripts for containers)? How to establish a convenient workflow
👉 Structuring the Docker setup for PHP Projects (2019-05-20)
An update of the previous article with the learnings of the past 3 years:
👉 Docker from scratch for PHP 8.1 Applications in 2022 (2022-03-21)
An update of the previous article on setting up PhpStorm (Part 2) using the latest PHP version (PHP 8.1) as well as the latest Xdebug version (3). The article also covers additional debugging challenges (from the browser, from the CLI, from a long running worker process).
👉 PhpStorm, Docker and Xdebug 3 on PHP 8.1 in 2022 (2022-03-22)
A step-by-step walk through to set up a new Laravel 9 project on the docker setup of this tutorial, using a couple of common Laravel components (Commands, Controllers, Queues, Databases).
👉 Run Laravel 9 on Docker in 2022 (2022-03-23)
Set up some PHP QA tools like
phpstan, etc. in the dockerized PHP application and
make targets to run them either in parallel or individually.
👉 Set up PHP QA tools and control them via make (2022-04-25)
git secretto encrypt secrets in the repository
git secret to encrypt and store secrets directly in a git repository. All required
tools are set up in Docker and their usage is defined via
👉 Use git-secret to encrypt secrets in the repository (2022-04-25)
Create a CI pipeline using the dockerized setup introduced in the previous tutorial that can be executed on any CI provider. Concrete examples for Gitlab Pipelines and Github actions are included.
👉 Create a CI pipeline for dockerized PHP Apps (2022-04-25)