Home for yannoff/php-fpm dockerhub repository sources.
A PHP-FPM docker image based on Alpine, with composer and offenbach installed.
- 8.0-fpm-alpine , 8.0
- 7.4-fpm-alpine , 7.4
- 7.3-fpm-alpine , 7.3
- 7.2-fpm-alpine
- 7.1-fpm-alpine (1)
- 7.0-fpm-alpine (1)
- 5.6-fpm-alpine (1)
- 5.5-fpm-alpine (1)
(1) Those PHP versions have now reached their EOL.
This means they are not officially supported anymore by the PHP Group.
By default, each image is bundled with the following extensions:
- bcmath
- intl
- opcache
- pdo_mysql
- pdo_pgsql
and the base APK packages:
- vim
- git
- bash
Building a custom image, using the apposite build arguments, allows a full-control over the installed extensions and let install extra
APK
packages on-demand.
Several ways to use the compiled images:
docker run -d --rm --name fpm7 -v /var/www/html:/var/www/html -p 9000:9001 yannoff/php-fpm:7.3
See the apposite docker reference for details on docker run
options.
# docker-compose.yaml
fpm:
image: yannoff/php-fpm:7.3
# Here the exposed port on host machine is left unset,
# letting docker allocate it automatically to a free available port
ports:
- 9000
volumes:
- /your/web/document/root:/www
working_dir: /www
See the docker compose reference for details on the docker-compose.yaml
file syntax and options.
The following build arguments are available:
Build arg | Description |
---|---|
PHP_EXTS |
PHP extensions to be installed at build time (2) |
APK_ADD |
Extra apk packages to be installed at build time |
(2) See the mlocati/docker-php-extension-installer repository for the full list of supported extensions.
There are 2 different methods to build the image:
Build directly using the repository URL:
Use case: PHP version 7.3 with imap
extension only
$ docker build -t php73 --build-arg PHP_EXTS=imap git@github.com:yannoff/docker-php-fpm.git#:7.3
Use case: PHP version 8.0 with gd
and imap
extensions, PLUS tzdata
extra APK package install
# docker-compose.yaml
fpm:
build:
context: https://github.com/yannoff/docker-php-fpm.git#:8.0
args:
PHP_EXTS: gd imap
APK_ADD: tzdata
Use case: PHP version 7.1 with gd
and imap
extensions
- Clone this repository or fetch a zipball.
- Build the image from the working directory
$ docker build -t customimage:7.1 --build-arg PHP_EXTS='gd imap' 7.1/
Licensed under the MIT License.
This project uses the awesome mlocati/docker-php-extension-installer script for PHP extensions install.