Sign inSign up

tigercomputing/debian-php-fpm

By tigercomputing

•Updated about 10 hours ago

These images are based on Debian's debian:*-slim images, and include PHP-FPM

Image
0

50K+

tigercomputing/debian-php-fpm repository overview

⁠PHP-FPM on Debian

These images are based on Debian's debian:*-slim images, and include PHP-FPM.

The jammy-php7.4 image is the exception: it is based on Ubuntu's ubuntu:jammy (22.04) image, with PHP 7.4 from Ondřej Surý's repository⁠. It is intended as a drop-in replacement for the bullseye image, now that Debian 11 no longer receives security updates; the PHP version, extensions and configuration are the same.

⁠Quick reference

⁠How to use this image

This image provides only a php-fpm FastCGI endpoint running on TCP port 9000. You will need to pair it with an external web server to serve static resources and anything else that isn't PHP.

⁠Basic web application

Create a Dockerfile for your web application that looks something like:

FROM tigercomputing/debian-php-fpm:trixie
COPY src/ /var/www/html/

Where src/ is the directory containing all your PHP code. Then, run the commands to build and run the Docker image:

$ docker build -t my-php-app .
$ docker run -d --name my-running-app my-php-app

⁠Installing PHP extensions

These images are based on Debian and use Debian's PHP packages. To install extensions, use apt-get install with the appropriate package name, for example:

FROM tigercomputing/debian-php-fpm:trixie

RUN set -eux -o pipefail; \
  export DEBIAN_FRONTEND=noninteractive; \
  apt-get update; \
  apt-get install -y --no-install-recommends \
    php-ldap \
    php-xmlrpc \
  ; \
  apt-get distclean

COPY src/ /var/www/html/
⁠Ubuntu (jammy-php7.4) image

Surý's repository is already configured in this image, so further PHP 7.4 extensions can be installed the same way. Always use the versioned package names (php7.4-ldap, not php-ldap): the unversioned packages depend on the newest PHP release and would install it alongside PHP 7.4. Ubuntu 22.04's apt does not have apt-get distclean, so remove the package lists by hand:

FROM tigercomputing/debian-php-fpm:jammy-php7.4

RUN set -eux; \
  export DEBIAN_FRONTEND=noninteractive; \
  apt-get update; \
  apt-get install -y --no-install-recommends \
    php7.4-ldap \
    php7.4-xmlrpc \
  ; \
  rm -rf /var/lib/apt/lists/*

COPY src/ /var/www/html/

⁠Configuration

The image ships with a vanilla php.ini configuration. You can drop additional INI files into /etc/php/conf.d/ within your images and they will be loaded into the running php-fpm instance.

Similarly, php-fpm itself can be configured by dropping *.conf files into the same /etc/php/conf.d/ directory.

You can also drop scripts into the /entrypoint.d/ directory. These will be run by the default entry point (/entrypoint.sh) using run-parts before php-fpm is started. Files dropped into this directory must be executable and must match the following regular expression: ^[A-Za-z0-9_-]+$ - note that this does not include dot (.), so do not use file extensions. See Debian's run-parts(8)⁠ man page for further information.

Tag summary

Content type

Image

Digest

sha256:f1e109d88…

Size

73.5 MB

Last updated

about 10 hours ago

docker pull tigercomputing/debian-php-fpm