This creates a Docker container running PHP on Alpine Linux.
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.
It also includes the (https://wiki.archlinux.org/index.php/SSMTP)[ssmtp] package so that after its configured you can use PHP's mail() function.
docker run -p 80:80 -p 443:443 -v /var/www/html:/srv stevepacker/caddy-php7
PHP_BEFORE
: command(s) to run prior to runningcomposer install
andphp-fpm
PHP_COMPOSER_FLAGS
: flags to include withcomposer install
(ex: --prefer-dist --no-dev)PHP_AFTER
: command(s) to run aftercomposer install
andphp-fpm
/srv
: Base directory. If acomposer.lock
is in this directory,composer install
will automatically run prior to startingphp-fpm
/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./etc/ssmtp/ssmtp.conf
: If you intend to use PHP's mail() function, configure this file./etc/ssmtp/revaliases
: Another configuration file for ssmtp
- git
- ipfilter
- composer
- php7-fpm
- ... and a bunch of others. Read the Dockerfile.