Skip to content

CleatSquad/magento-frankenphp-images

Magento FrankenPHP Docker Images

FrankenPHP Logo

Docker Pulls Magento 2.4.x PHP Versions FrankenPHP 1.10 License MIT

HTTP/3 Brotli Early Hints TLS 1.3 JIT

πŸš€ High-performance Docker images for Magento 2 with FrankenPHP.

Supported Tags

Tag PHP Type Description
php8.4-fp1.10.1-base 8.4 Base Production ready
php8.4-fp1.10.1-dev 8.4 Dev With Xdebug
php8.3-fp1.10.1-base 8.3 Base Production ready
php8.3-fp1.10.1-dev 8.3 Dev With Xdebug
php8.2-fp1.10.1-base 8.2 Base Production ready
php8.2-fp1.10.1-dev 8.2 Dev With Xdebug
latest 8.4 Base Default
base 8.4 Base Alias
dev 8.4 Dev Alias

Quick Start

Development

services:
  app:
    image: mohelmrabet/magento-frankenphp:php8.4-fp1.10.1-dev
    environment:
      - USER_ID=1000
      - GROUP_ID=1000
    volumes:
      - ./src:/var/www/html
    ports:
      - "80:80"
      - "443:443"

Production

FROM mohelmrabet/magento-frankenphp:php8.4-fp1.10.1-base

COPY --chown=www-data:www-data . /var/www/html/

USER www-data
RUN composer install --no-dev --optimize-autoloader
RUN bin/magento setup:di:compile
RUN bin/magento setup:static-content:deploy -f

Features

Base Image

  • βœ… PHP 8.2, 8.3, 8.4
  • βœ… FrankenPHP 1.10.1
  • βœ… All Magento PHP extensions
  • βœ… Composer 2
  • βœ… OPcache optimized

Dev Image

  • βœ… Everything in Base +
  • βœ… Xdebug 3
  • βœ… mkcert (local HTTPS)
  • βœ… Self-signed SSL certificates (auto-generated)
  • βœ… git
  • βœ… Mailhog support
  • βœ… Runtime UID/GID mapping

Performance Features

  • πŸš€ HTTP/3 (QUIC) - 10-50% faster page loads
  • ⚑ Early Hints (HTTP 103) - Preload critical resources
  • πŸ“¦ Brotli Compression - 20-25% better compression than gzip
  • 🎯 Optimized Caching - Immutable cache headers for static assets
  • πŸ”’ TLS 1.3 - Faster handshakes with 0-RTT resumption
  • 🎨 Modern Image Formats - AVIF, WebP support with Vary headers

PHP Extensions

bcmath, gd, intl, mbstring, opcache, pdo_mysql, soap, xsl, zip, sockets, ftp, sodium, redis, apcu

Environment Variables (Dev)

Variable Default Description
USER_ID 1000 UID for www-data
GROUP_ID 1000 GID for www-data
MAGENTO_RUN_MODE developer Magento mode
SERVER_NAME localhost Server hostname for SSL
ENABLE_SSL_DEV true Enable self-signed SSL

Xdebug Configuration (Dev)

Xdebug can be configured via environment variables:

Variable Default Description
XDEBUG_MODE debug Xdebug mode (debug, coverage, develop, profile, trace, off)
XDEBUG_CLIENT_HOST host.docker.internal IDE host address
XDEBUG_CLIENT_PORT 9003 IDE listening port
XDEBUG_START_WITH_REQUEST trigger When to start debugging (trigger, yes, no)
XDEBUG_IDEKEY PHPSTORM IDE key for session identification

Example:

services:
  app:
    image: mohelmrabet/magento-frankenphp:dev
    environment:
      XDEBUG_MODE: debug
      XDEBUG_CLIENT_HOST: host.docker.internal
      XDEBUG_CLIENT_PORT: 9003

Caddyfile Configuration

The Caddyfile can be customized by mounting your own template:

volumes:
  - ./my-Caddyfile.template:/etc/caddy/Caddyfile.template:ro

See the Caddyfile Configuration Guide for detailed documentation.

Links

Documentation

Guide Description
Getting Started Installation and initial setup
Configuration Environment variables and settings
Caddyfile Web server configuration
Xdebug Debugging with Xdebug
Performance HTTP/3, Early Hints, Brotli optimization

License

MIT β€” see LICENSE