Sign inSign up

mappia/magento-php

By mappia

Updated 3 days ago

Lightweight base PHP image for Magento , preconfigured for production Magento 2 applications. 🚀

Image
Languages & frameworks
2

10K+

mappia/magento-php repository overview

Mappia

mappia/magento-php

Docker Hub

Base PHP images tailored for Magento 2. Each image ships every PHP extension Magento requires, Composer, and an opcache-tuned php.ini suited to immutable container deployments.

These are base images — they contain no Magento source. Use them as the FROM for your own store image (see Building Magento Containers), or use the prebuilt mappia/magento2 images to run stock Magento.

Variants

VariantBasePurpose
cli-alpinephp:<ver>-cli-alpineSetup, cron, indexers, bin/magento — anything command-line.
fpm-alpinephp:<ver>-fpm-alpineServing PHP over PHP-FPM for web requests.
devcontainerphp:<ver>-fpm (Debian)Local development: Xdebug, Mailpit, n98-magerun2, non-root dev user. Not for production.

Supported PHP versions

Tag suffixcli-alpinefpm-alpinedevcontainer
8.2
8.3
8.4
8.5

Tags

A tag is [<prefix>-]<variant><php>, e.g. cli-alpine8.4 or 20250421-fpm-alpine8.3.

FlavorExampleDigestCadence
🌲 Evergreen Tagscli-alpine8.4movesRe-pushed weekly and on every release.
🏔️ Mappia version Tagsv0.9.0-alpha.2-cli-alpine8.4fixedOnce, when that Mappia release is published.
⏱️ Date Tags20250421-cli-alpine8.4fixedA new date tag every Monday.

Pick a fixed-digest tag (Mappia version or date) for anything you deploy — evergreen tags rebuild underneath you and pick up new upstream PHP and Alpine packages.

What's inside

cli-alpine / fpm-alpine

  • PHP extensions: bcmath, ftp, gd (freetype + jpeg), intl, pdo_mysql, soap, sockets, xsl, zip
  • System packages: mysql-client, gzip, patch, procps, lsof, and the -dev headers the extensions need
  • Composer 2 at /usr/local/bin/composer
  • A tuned /usr/local/etc/php/php.ini: memory_limit = 4G, upload_max_filesize/post_max_size 20M, max_execution_time = 30, display_errors = Off, log_errors = On
  • OPcache tuned for a Magento-sized codebase in an immutable image: memory_consumption = 200, max_accelerated_files = 65407, interned_strings_buffer = 32, save_comments = 1 (Magento needs annotations), validate_timestamps = 0
  • WORKDIR /var/www/html, mode 775

Important

`opcache.validate_timestamps = 0` means PHP never re-reads changed files. That is the point for a baked production image, but it will confuse you if you bind-mount source over `/var/www/html` — use the `devcontainer` variant for that.

devcontainer (Debian-based, everything above plus)

  • Xdebug: mode=debug,profile, client_port=9003, start_with_request=trigger, cachegrind output to /tmp/cachegrind
  • Mailpit as sendmail_path, pointed at host mailpit:1025 (checksum-pinned, amd64 + arm64)
  • n98-magerun2, redis-tools, default-mysql-client (with skip-ssl), git, vim, zip/unzip
  • php.ini from php.ini-development with memory_limit = 2500M
  • dev user (uid 1000, primary group www-data remapped to gid 1000) for host filesystem compatibility — set "remoteUser": "dev" in devcontainer.json
  • WORKDIR /workspace, group-writable; CMD ["php-fpm"]

Usage

ARG BASE_IMAGE="mappia/magento-php:v0.9.0-alpha.2-cli-alpine8.4"
FROM ${BASE_IMAGE}

COPY composer.json composer.lock ./
RUN composer install --no-dev --no-progress --no-interaction
COPY . .

Build both halves of your store from the same source, swapping only the base:

docker build --target cli --build-arg BASE_IMAGE=mappia/magento-php:v0.9.0-alpha.2-cli-alpine8.4 -t my-store:cli .
docker build --target fpm --build-arg BASE_IMAGE=mappia/magento-php:v0.9.0-alpha.2-fpm-alpine8.4 -t my-store:fpm .

Tag summary

Content type

Image

Digest

sha256:a9f0169fc

Size

61.3 MB

Last updated

3 days ago

docker pull mappia/magento-php:20260914-fpm-alpine8.4