Image Variations

FPM

The fpm variation runs PHP-FPM alone and answers FastCGI requests on port 9000, so you bring the web server. Choose it when you already run NGINX, Caddy, or another FastCGI-capable server, or want to scale PHP separately from it. If you want the web server in the same container, use fpm-nginx, fpm-apache, or frankenphp. Compare every variation →

At a glance

fpm
Processesphp-fpm only. No S6 Overlay; the FPM master manages its own workers.
Ports9000 (FastCGI, not HTTP)
Stop signalSIGQUIT (FPM finishes in-flight requests, then exits)
Default health checkphp-fpm-healthcheck, which reads FPM's status page
Webroot variableNone. Your web server sets the document root.
PHP versions8.1 to 8.6
Operating systemsDebian and Alpine

Quick start

This Compose file runs PHP-FPM and the official NGINX image side by side. Both mount the same code, because NGINX serves static files itself and passes only PHP requests to FPM.

compose.yml
services:
  php:
    image: serversideup/php:8.5-fpm
    volumes:
      - ./:/var/www/html

  nginx:
    image: nginx:1.30-alpine
    ports:
      - "80:80"
    volumes:
      - ./:/var/www/html
      - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
    depends_on:
      - php

fastcgi_pass php:9000 uses the Compose service name as the host name. The file path in SCRIPT_FILENAME is resolved inside the PHP container, so mount the code at the same path in both containers.

Health check

The image's health check runs php-fpm-healthcheck, which passes when FPM's status page answers. Add options to fail on load as well, such as --listen-queue=10 to fail when more than 10 requests are waiting:

compose.yml
services:
  php:
    image: serversideup/php:8.5-fpm
    healthcheck:
      test: ["CMD", "php-fpm-healthcheck", "--listen-queue=10"]

For Laravel queue, Horizon, and scheduler health checks, see Laravel health checks.

Configuration

Set PHP and PHP-FPM options with PHP_* and PHP_FPM_* environment variables. All of them, with defaults, are in the environment variable specification. To size the FPM process pool for your server, see production performance tuning.