Sign inSign up

civirmx/php-fpm-alpine

By civirmx

•Updated about 11 hours ago

PHP FPM base images with common libraries and database connectors for building applications

Image
Languages & frameworks
Integration & delivery
Developer tools
0

2.4K

civirmx/php-fpm-alpine repository overview

⁠CIVIR México - PHP-FPM Docker Images

Pre-built PHP-FPM base images on Alpine Linux with the most common PHP extensions and database connectors already compiled and enabled.

⁠Why use these images?

Compiling PHP extensions (GD, Intl, Imagick, SQL Server drivers, etc.) is the slowest part of most PHP Docker builds. These images do that work once, so your application images can start FROM them and skip straight to copying code and running composer install.

  • Faster CI/CD builds for downstream images
  • Consistent extension set across projects
  • Multi-arch: linux/amd64 and linux/arm64
  • Small footprint (Alpine-based)

⁠Supported PHP versions

PHPBase image
7.4php:7.4-fpm-alpine
8.2php:8.2-fpm-alpine
8.3php:8.3-fpm-alpine
8.4php:8.4-fpm-alpine

Warning — PHP 7.4 is for legacy applications only. PHP 7.4 reached end of life in November 2022 and no longer receives security updates. Its use is discouraged; please migrate to PHP 8.2 or newer.

⁠Variants (database connectors)

Each PHP version is published in four variants. Pick the smallest one that matches your database.

VariantMySQL / MariaDBPostgreSQLSQL Server
all-db✔✔✔
mysql✔
pgsql✔
mssql✔
DatabasePHP extensionsSystem libraries
MySQL / MariaDBmysqli, pdo_mysql—
PostgreSQLpgsql, pdo_pgsqlpostgresql-dev
SQL Serversqlsrv, pdo_sqlsrv (PECL)Microsoft ODBC Driver 18 (msodbcsql18), mssql-tools18, unixodbc-dev

SQL Server driver versions: 5.10.1 on PHP 7.4, 5.12.0 on PHP 8.2, latest PECL release on PHP 8.3/8.4.

⁠Included in every variant

Core PHP extensions

bcmath, calendar, curl, dom, exif, fileinfo, gd (with JPEG + FreeType), gettext, intl, mbstring, opcache, pcntl, simplexml, soap, sockets, xml, zip

PECL extensions

ExtensionPurpose
apcuIn-memory user cache (apc.enable_cli=1 enabled)
imagickImageMagick bindings for image processing
redisRedis client (6.0.2 on PHP 7.4)
pcovCode coverage driver for PHPUnit

Tools

  • Composer 2.9.5 (/usr/local/bin/composer)
  • git, unzip, curl, openssh-client, gnupg, openssl, ca-certificates, tzdata
  • ImageMagick
  • Build toolchain ($PHPIZE_DEPS, autoconf, g++, make, libtool) so you can add further extensions with pecl install / docker-php-ext-install

⁠Tags

civirmx/base-php-fpm-alpine:php<PHP_VERSION>-<VARIANT>-<IMAGE_VERSION>
civirmx/base-php-fpm-alpine:php<PHP_VERSION>-<VARIANT>-latest

Examples:

  • civirmx/base-php-fpm-alpine:php8.4-mysql-latest
  • civirmx/base-php-fpm-alpine:php8.2-all-db-latest
  • civirmx/base-php-fpm-alpine:php7.4-mssql-latest

⁠Usage

FROM civirmx/base-php-fpm-alpine:php8.4-mysql-latest

WORKDIR /var/www/html
COPY composer.json composer.lock ./
RUN composer install --no-dev --no-scripts --no-autoloader
COPY . .
RUN composer dump-autoload --optimize
  • Exposes port 9000
  • Entrypoint: php-fpm

Verify installed extensions:

docker run --rm --entrypoint php civirmx/base-php-fpm-alpine:php8.4-all-db-latest -m

⁠Notes

  • SQL Server variants (all-db, mssql) support amd64 and arm64 only.
  • The build toolchain is intentionally kept in the image. For slim production images, use a multi-stage build.

Tag summary

Content type

Image

Digest

sha256:f623a3b2a…

Size

371.8 MB

Last updated

about 11 hours ago

docker pull civirmx/php-fpm-alpine:php8.4-all-db-latest