c0ns0l3/php-alpine

By c0ns0l3

Updated 10 days ago

PHP-FPM alpine v.8.2/8.3

Image
Languages & frameworks
Web servers
0

1.5K

c0ns0l3/php-alpine repository overview

PHP 8.3-FPM Alpine — dev image

Multi-stage Docker image based on php:8.3-fpm-alpine3.21, built for a Laravel/PHP stack with a wide set of extensions, Node.js runtime, Chromium (Puppeteer), and Composer baked in.

Structure

The image is built in two stages:

StageBasePurpose
builderphp:8.3-fpm-alpine3.21Installs all -dev / build tooling (gcc, cmake, autoconf, etc.) and compiles every PHP extension. Discarded after build — none of it ends up in the final image.
runtimephp:8.3-fpm-alpine3.21Only runtime libraries + the compiled extensions (.so files and .ini configs) copied over from builder. This is the image you actually ship.

Both stages use the same base image tag, so the PHP extension ABI directory matches between them and the copied .so files load without recompilation.

PHP extensions (final image)

Bundled (docker-php-ext-install):

  • gd
  • imap
  • pdo_mysql
  • zip
  • gettext
  • gmp
  • bcmath
  • bz2
  • exif
  • intl
  • mysqli
  • opcache
  • pdo_dblib
  • pcntl
  • pdo_pgsql
  • pgsql
  • sodium
  • soap
  • tidy
  • xsl
  • ftp

PECL:

  • amqp
  • apcu
  • imagick
  • igbinary
  • memcache
  • msgpack
  • oauth
  • uuid
  • yaml
  • vips
  • ssh2
  • mongodb
  • redis (with igbinary, zstd, msgpack, lz4 serializers enabled)

Built from source:

Other: ffi.enable = 1 is set if the ffi extension is present in the base image.

Verify the actual list after a build:

docker run --rm myapp-php:8.3 php -m

System packages (apk, runtime stage)

  • bash
  • bash-completion
  • bash-doc
  • c-client
  • ca-certificates
  • chromium
  • ffmpeg
  • freetds
  • freetype
  • gettext
  • ghostscript
  • git
  • gmp
  • htop
  • icu-libs
  • imagemagick
  • imap
  • jpegoptim
  • libffi
  • libgmpxx
  • libheif
  • libintl
  • libjpeg-turbo
  • libpng
  • libpq
  • librdkafka
  • libssh2
  • libstdc++
  • libtool
  • libxpm
  • libxslt
  • libzip
  • lz4-libs
  • make
  • mc
  • py3-pip
  • python3
  • rabbitmq-c
  • shadow
  • su-exec
  • supervisor
  • tidyhtml
  • tzdata
  • unixodbc
  • vips
  • xvfb
  • yaml
  • zstd-libs

Also included

  • Composer (official installer script)
  • Node.js 22.23.0 (binaries/libs lifted from the official node:22.23.0-alpine image)
  • Chromium + PUPPETEER_EXECUTABLE_PATH
  • curl-impersonate (c0ns0l3/curl-impersonate)
  • www-data remapped to UID 1000

Builder-stage only (NOT in the final image)

Compilers and -dev packages:

  • autoconf
  • bzip2-dev
  • cmake
  • curl-dev
  • freetds-dev
  • freetype-dev
  • g++
  • gcc
  • gettext-dev
  • git
  • gmp-dev
  • icu-dev
  • imagemagick-dev
  • imap-dev
  • krb5-dev
  • libc-dev
  • libheif-dev
  • libjpeg-turbo-dev
  • libpng-dev
  • librdkafka-dev
  • libssh2-dev
  • libwebp-dev
  • libxml2-dev
  • libxpm-dev
  • libxslt-dev
  • libzip-dev
  • lz4-dev
  • make
  • openssl
  • openssl-dev
  • pcre-dev
  • pkgconf
  • postgresql-dev
  • rabbitmq-c-dev
  • tesseract-ocr
  • tesseract-ocr-dev
  • tidyhtml-dev
  • unixodbc-dev
  • vips-dev
  • yaml-dev
  • zlib-dev
  • zstd-dev
  • libsodium-dev

⚠️ tesseract-ocr currently lives only in the builder stage and is not copied into runtime — it is not present in the final image, even though the package name appears in the Dockerfile. If you need it available inside the running container (not just at build time), add tesseract-ocr to the runtime-stage apk list.

Build

DOCKER_BUILDKIT=1 docker build -t myapp-php:8.3 .

Tag summary

Content type

Image

Digest

sha256:cdbd7aba3

Size

437.5 MB

Last updated

10 days ago

docker pull c0ns0l3/php-alpine:8.3