Lightweight base PHP image for Magento , preconfigured for production Magento 2 applications. 🚀
10K+
mappia/magento-phpBase 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.
| Variant | Base | Purpose |
|---|---|---|
cli-alpine | php:<ver>-cli-alpine | Setup, cron, indexers, bin/magento — anything command-line. |
fpm-alpine | php:<ver>-fpm-alpine | Serving PHP over PHP-FPM for web requests. |
devcontainer | php:<ver>-fpm (Debian) | Local development: Xdebug, Mailpit, n98-magerun2, non-root dev user. Not for production. |
| Tag suffix | cli-alpine | fpm-alpine | devcontainer |
|---|---|---|---|
8.2 | ✅ | ✅ | ✅ |
8.3 | ✅ | ✅ | ✅ |
8.4 | ✅ | ✅ | ✅ |
8.5 | ✅ | ✅ | ✅ |
A tag is [<prefix>-]<variant><php>, e.g. cli-alpine8.4 or 20250421-fpm-alpine8.3.
| Flavor | Example | Digest | Cadence |
|---|---|---|---|
| 🌲 Evergreen Tags | cli-alpine8.4 | moves | Re-pushed weekly and on every release. |
| 🏔️ Mappia version Tags | v0.9.0-alpha.2-cli-alpine8.4 | fixed | Once, when that Mappia release is published. |
| ⏱️ Date Tags | 20250421-cli-alpine8.4 | fixed | A 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.
cli-alpine / fpm-alpine
bcmath, ftp, gd (freetype + jpeg), intl, pdo_mysql, soap, sockets, xsl, zipmysql-client, gzip, patch, procps, lsof, and the -dev headers the extensions need/usr/local/bin/composer/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 = Onmemory_consumption = 200, max_accelerated_files = 65407, interned_strings_buffer = 32, save_comments = 1 (Magento needs annotations), validate_timestamps = 0WORKDIR /var/www/html, mode 775Important
`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)
mode=debug,profile, client_port=9003, start_with_request=trigger, cachegrind output to /tmp/cachegrindsendmail_path, pointed at host mailpit:1025 (checksum-pinned, amd64 + arm64)redis-tools, default-mysql-client (with skip-ssl), git, vim, zip/unzipphp.ini from php.ini-development with memory_limit = 2500Mdev user (uid 1000, primary group www-data remapped to gid 1000) for host filesystem compatibility — set "remoteUser": "dev" in devcontainer.jsonWORKDIR /workspace, group-writable; CMD ["php-fpm"]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 .
Content type
Image
Digest
sha256:a9f0169fc…
Size
61.3 MB
Last updated
3 days ago
docker pull mappia/magento-php:20260914-fpm-alpine8.4