johnefemer / docker-php-tutorial

Example files of my tutorial on PHP on Docker (check out the branches!)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker PHP Tutorial - Learning Docker for PHP Developers

In this tutorial I'll take you on "my" journey of learning Docker as a PHP developer. Since I actively use everything explained along the way (and force it upon my team ;)) I can hopefully shed some light onto some more advanced issues like cross-OS-setups and seamless IDE integration.

Two words of caution:

  • I tend to write rather lengthy, in-dept articles so you should allocate some time to work it all through
  • my main OS is Windows. Although most of the things should be easily transferable into OSX/Linux you might run into some quirks that I didn't encounter.

Setup

Each tutorial is placed in a separate branch and has an accompanying article in my blog I recommend cloning the full repository and check out the corresponding branch for easy reference. Example:

mkdir -p /c/codebase
cd /c/codebase/
git clone https://github.com/paslandau/docker-php-tutorial.git
cd docker-php-tutorial

git checkout part_2_setting-up-phpstorm-with-xdebug-for-local-development-on-docker

Tutorials

Please subscribe to my RSS Feed and/or subscribe via email to be automatically notified when a new part gets published. I'll also probably brag about it on Twitter ;)

Playlist

There a YouTube playlist available containing all videos of the tutorial series.

Published

Planned (already used by us but not put into writing):

Roadmap (wow much want, such little time):

Setting up PHP, PHP-FPM and NGINX for local development on Docker

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?

Setting up PhpStorm with Xdebug for local development on Docker

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)?

Structuring the Docker setup for PHP Projects

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 via make?

Docker from scratch for PHP 8.1 Applications in 2022

An update of the previous article (Part 3) with the learnings of the past 3 years:

  • simplify the setup
  • add more containers (redis, mysql, workers)
  • prepare for additional environments (CI, production)

PhpStorm, Docker and Xdebug 3 on PHP 8.1 in 2022

An update of the pervious 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).

Run Laravel 9 on Docker in 2022

A step-by-step walkthrough 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).

Set up PHP QA tools and control them via make

Use git secret to encrypt secrets in the repository

Create a CI pipeline for dockerized PHP Apps

Deploy dockerized PHP Apps on a GCP VM

  • Status: draft
  • Link:
  • Branch:

Scaling Dockerized PHP Applications with Terraform and Kubernetes on GCP/AWS

  • Status: Dream Caused by the Flight of a Bee Around a Pomegranate a Second Before Awakening
  • Link:
  • Branch:

About

Example files of my tutorial on PHP on Docker (check out the branches!)