tausolutionsmx/builder-php-fpm-alpine

By tausolutionsmx

Updated 22 days ago

PHP FPM Alpine base image with dev tools and database drivers

Image
Languages & frameworks
Developer tools
0

882

tausolutionsmx/builder-php-fpm-alpine repository overview

PHP-FPM Alpine Images

Alpine-based PHP-FPM images maintained by Tau Solutions MX. Builder images include Composer and tools for dependency installation. Runtime images keep the same PHP versions and database variants, but remove build-only tools and development packages from the final image.

Images

tausolutionsmx/builder-php-fpm-alpine
tausolutionsmx/runtime-php-fpm-alpine

Supported PHP Versions

  • php7.4
  • php8.2
  • php8.4

Variants

VariantRuntime database drivers
mysqlMySQL / MariaDB: mysqli, pdo_mysql
pgsqlPostgreSQL: pgsql, pdo_pgsql
mssqlMicrosoft SQL Server: sqlsrv, pdo_sqlsrv
all-dbMySQL, PostgreSQL, and Microsoft SQL Server

Builder variants include Composer 2.9.5, git, unzip, and common build-time PHP extensions used by Tau projects: calendar, soap, sockets, exif, bcmath, mbstring, pcntl, intl, gettext, curl, dom, fileinfo, opcache, simplexml, xml, gd, and zip. The mysql, pgsql, and all-db builders also include their non-PECL database extensions for Composer platform checks.

Runtime variants include the application runtime extensions and drivers, including imagick, apcu, and redis. The mssql and all-db runtime variants also include sqlsrv, pdo_sqlsrv, and Microsoft ODBC Driver 18. Runtime images omit Composer, git, unzip, $PHPIZE_DEPS, and development packages such as *-dev.

The container exposes port 9000 and starts with php-fpm.

Tags

Versioned tags use this format:

<php-version>-<variant>-<image-version>

Latest tags are scoped to each PHP version and variant:

<php-version>-<variant>-latest

Examples:

php7.4-mysql-1.0
php7.4-mysql-latest
php8.2-pgsql-1.0
php8.2-pgsql-latest
php8.4-all-db-1.0
php8.4-all-db-latest

Usage

Use a specific version when you want reproducible builds:

FROM tausolutionsmx/runtime-php-fpm-alpine:php8.2-mysql-1.0

WORKDIR /var/www/html
COPY . .

Use builder images for dependency installation stages:

FROM tausolutionsmx/builder-php-fpm-alpine:php8.2-mysql-latest AS builder

WORKDIR /app
COPY composer.json composer.lock ./
RUN composer install \
    --no-dev \
    --prefer-dist \
    --no-interaction \
    --optimize-autoloader \
    --ignore-platform-req=ext-redis \
    --ignore-platform-req=ext-imagick
COPY . .

FROM tausolutionsmx/runtime-php-fpm-alpine:php8.2-mysql-latest

WORKDIR /var/www/html
COPY --from=builder /app /var/www/html

The builder images intentionally do not install PECL runtime extensions. If your composer.json requires extensions that only exist in the runtime image, ignore those platform requirements during the builder stage:

composer install --no-dev --prefer-dist --no-interaction --optimize-autoloader \
  --ignore-platform-req=ext-redis \
  --ignore-platform-req=ext-imagick \
  --ignore-platform-req=ext-apcu \
  --ignore-platform-req=ext-sqlsrv \
  --ignore-platform-req=ext-pdo_sqlsrv

Use only the flags that match your project. The runtime image still contains those extensions, so the final production container can load them while staying smaller than the builder image.

Notes

Builder images do not install PECL extensions or Microsoft ODBC packages. Runtime MSSQL variants install only Microsoft ODBC Driver 18 through install-mssql.sh; mssql-tools18 is intentionally omitted. MSSQL runtime variants are intended for linux/amd64 and linux/arm64 builds.

Tag summary

Content type

Image

Digest

sha256:9bc781994

Size

368.4 MB

Last updated

22 days ago

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