PHP Development - Docker & Swarm Container
Introduction
This is a template Docker development and Swarm container for PHP developers. To get started with this container for your PHP project (including Composer and PHPUnit), see the quick setup reference.
- Debian container with Apache, PHP, PHP-FPM (CGI gateway), PHPUnit, Symfony, and Codeception (TODO: AddOn)
- Instructions for adding additional PHP versions
- Instructions for creating a development container - Use this to create and start a local container for development and testing.
- Instructions for configuring PHP debugging (Xdebug)
- Instructions for creating an optional Swarm, which involves:
- Install Multipass (see Multipass)
- Create multiple virtual machines with Multipass (required for the swarm)
- Initialize the swarm and define VMs as Docker Manager or Docker Worker nodes
- Create a Docker image for the swarm
- Publish the image to a registry (Docker Hub)
- Deploy the swarm service (pulling the image from Docker Hub)
You can use this container to develop your PHP based application, a simple sample application is available in the directory: \ApachePHPWebService\app. Or use it to test the docker swarm functionality.
For the first stable release, use the release/1.0 template branch
Where to Start
More documents can be found in the Howtos directory. It contains:
- How to create a development container - Set up your local development environment
- How to create a Swarm - Deploy multiple container instances
- How to install other PHP versions - Add alternative PHP versions
- How to configure debugging - Set up Xdebug and debugging tools
- Document root adjustments in: /usr/local/apache2/conf/extra/httpd-vhosts.conf
License
This file is part of: PHP Development Template Stack Copyright (c) 2025-2026 Nico Jan Eelhart.This repository is MIT licensed and free to use. For optional commercial support, customization, training, or long-term maintenance, see COMMERCIAL.md.
─── ✦ ───