diff --git a/Dockerfile b/Dockerfile index 26b0ddf..9d3769c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -261,7 +261,8 @@ RUN set -eux; \ apt-get clean; \ rm -rf /var/lib/apt/lists/* -ENV PHP_INI_DIR /usr/local/etc/php +ENV PHP_INI_DIR="/usr/local/etc/php" \ + PHP_FPM_LISTEN=9000 RUN set -eux; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ @@ -317,7 +318,7 @@ RUN set -eux; \ echo 'daemonize = no'; \ echo; \ echo '[www]'; \ - echo 'listen = 9000'; \ + echo 'listen = ${PHP_FPM_LISTEN}'; \ } | tee php-fpm.d/zz-docker.conf # Override stop signal to stop process gracefully diff --git a/README.md b/README.md index 4244567..9263e62 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,13 @@ Because we have some legacy Symfony apps running that will eventually be phased * MySQL 5.7.30 See the [README](https://github.com/docker-library/docs/blob/master/php/README.md) of the official PHP Docker image for information on how to use this image. + +## Differences with the original image + +There are two deviations from the original image. This image contains a backported patch to fpm that changes the order in which configuration files are included from `/usr/local/etc/php-fpm.d`. By default in PHP 5.3 there was no sorting on the glob, causing files to be included in whatever order they appeared in the filesystem, which can differ from system to system. The patch removes the `GLOB_NOSORT` from the call to glob(), causing the files to be included in a alphabetic order. See [Dockerfile](Dockerfile) for details. + +This image also allows you to override the default listen directive of fpm. By default, it will listen on `0.0.0.0:9000`, but you can override this using the environment variable `PHP_FPM_LISTEN`. For example: + +``` +docker run -it -e PHP_FPM_LISTEN="localhost:9000" hrak/php-5.3:latest +```