You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: drupal/README.md
+27-4Lines changed: 27 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -310,16 +310,39 @@ This variant contains [PHP's FastCGI Process Manager (FPM)](https://www.php.net/
310
310
311
311
In order to use this image variant, some kind of reverse proxy (such as NGINX, Apache, or other tool which speaks the FastCGI protocol) will be required.
312
312
313
-
Some potentially helpful resources:
313
+
**WARNING:** the FastCGI protocol is inherently trusting, and thus *extremely* insecure to expose outside of a private container network -- unless you know *exactly* what you are doing (and are willing to accept the extreme risk), do not use Docker's `--publish` (`-p`) flag with this image variant.
314
+
315
+
### FPM configuration
316
+
317
+
This variant has a few FPM configuration files, each providing a small set of directives.
318
+
319
+
- `/usr/local/etc/php-fpm.conf`: This is the PHP upstream-provided main configuration file. The only thing that isn't commented out is the `include` for `php-fpm.d/*.conf` under the `[global]` section.
320
+
- `/usr/local/etc/php-fpm.d/docker.conf`: This is image specific configuration that makes FPM easier to run under Docker. With understanding, these may be overridden in user provided configuration.
321
+
- `/usr/local/etc/php-fpm.d/www.conf`: This is the PHP upstream-provided `www` pool configuration with minor modifications for the image. This may be edited, replaced, or overridden in later configuration files as needed.
322
+
- `/usr/local/etc/php-fpm.d/zz-docker.conf`: As of January 2026, this only contains `daemonize = no` under the `[global]` directive. This should not be overridden.
323
+
324
+
It is recommended to place user configuration in its own `.conf` file within `/usr/local/etc/php-fpm.d/`. Files are included in glob order, so they are sorted according to the collating sequence in effect in the current locale. Later files can override configuration from previous files. See also [FPM's Official Configuration Reference](https://www.php.net/manual/en/install.fpm.configuration.php).
325
+
326
+
Below is an example of adding custom FPM configuration using a Dockerfile.
327
+
328
+
```Dockerfile
329
+
FROM php:8-fpm
330
+
RUN set -eux; \
331
+
{ \
332
+
echo '[www]'; \
333
+
echo 'pm.status_path = /status'; \
334
+
} > /usr/local/etc/php-fpm.d/my-fpm.conf
335
+
```
336
+
337
+
Alternatively, a bind-mounted file at runtime can be used as long as the container user (`www-data` of the image by default) can read it (e.g. `--mount type=bind,src=path/to/my-fpm.conf,dst=/usr/local/etc/php-fpm.d/my-fpm.conf` on `docker run`). Special care must be taken when mounting a folder of configuration files over the whole `/usr/local/etc/php-fpm.d/` directory (e.g. `--mount type=bind,src=path/to/fpm.d/,dst=/usr/local/etc/php-fpm.d/`); this replaces the `php-fpm.d` directory of the image, so any necessary directives from the image-provided configuration files (like `daemonize = no`) must be in the user-provided files.
338
+
339
+
Some other potentially helpful resources:
314
340
315
-
- [FPM's Official Configuration Reference](https://www.php.net/manual/en/install.fpm.configuration.php)
316
341
- [Simplified example by @md5](https://gist.github.com/md5/d9206eacb5a0ff5d6be0)
317
342
- [Very detailed article by Pascal Landau](https://www.pascallandau.com/blog/php-php-fpm-and-nginx-on-docker-in-windows-10/)
- [Apache httpd Wiki example](https://wiki.apache.org/httpd/PHPFPMWordpress)
320
345
321
-
**WARNING:** the FastCGI protocol is inherently trusting, and thus *extremely* insecure to expose outside of a private container network -- unless you know *exactly* what you are doing (and are willing to accept the extreme risk), do not use Docker's `--publish` (`-p`) flag with this image variant.
322
-
323
346
# License
324
347
325
348
View [license information](https://www.drupal.org/licensing/faq) for the software contained in this image.
0 commit comments