Detection

migetpacks detects a PHP application when any of the following files are present in the project root:
  • composer.json
  • index.php

Version Detection

PHP version is resolved in the following priority order: Version constraints from composer.json (e.g., >=8.2, ^8.3) are normalized to Docker-compatible versions.
FrankenPHP supports PHP 8.2, 8.3, and 8.4. Older versions will fall back to PHP 8.2 with a warning.

Build Process

migetpacks generates a multi-stage Dockerfile using FrankenPHP (a modern PHP application server built on Go and Caddy):

PHP Extension Detection

Extensions declared in composer.json under require with the ext- prefix are automatically installed:

Web Root Detection

migetpacks automatically detects the web root directory by checking for these directories (in order):
  1. web/
  2. public/
  3. html/
  4. www/
  5. . (project root, fallback)

Run Command

The default run command uses FrankenPHP with Caddy:
Override with RUN_COMMAND or a Procfile:

PHP Configuration

Production PHP settings are automatically configured via environment variables: These can be overridden at runtime by setting the corresponding PHP_INI_* environment variable (e.g., PHP_INI_MEMORY_LIMIT=512M).

Caching

Layer Caching

Dependencies are cached by copying composer.json and composer.lock before the full source:

BUILD_CACHE_DIR

When BUILD_CACHE_DIR is set, Composer packages are cached at:

DHI Support

Docker Hardened Images (DHI) are not supported for PHP. FrankenPHP is a specialized application server that requires its own base image.
When USE_DHI=true is set, migetpacks will continue to use the standard FrankenPHP images.

Example

With custom environment variables