PHP7 (cli, fpm) with XDebug and Caddy Server on Alpine Linux
Caddy Server with PHP-FPM
This creates a Docker container running PHP on Alpine Linux.
Why another container?
I just wanted all the PHP libraries I tend to use.
It also supports running commands before and after starting PHP-FPM and running
composer install before running PHP-FPM.
docker run -p 80:80 -p 443:443 -v /var/www/html:/srv stevepacker/caddy-php7-xdebug
Docker Environment Variables
PHP_BEFORE: command(s) to run prior to running
PHP_COMPOSER_FLAGS: flags to include with
composer install(ex: --prefer-dist --no-dev)
PHP_AFTER: command(s) to run after
/srv: Base directory. If a
composer.lockis in this directory,
composer installwill automatically run prior to starting
/root/.caddy: When an SSL is generated, files are stored here by Caddy.
/etc/Caddyfile: If you intend to include your own Caddyfile, mount it here.
- ... and a bunch of others. Read the Dockerfile.
Docker Pull Command