What’s New in Docker‑PHP v4.0.0‑beta1? Deep Dive into FrankenPHP, Laravel Scripts, and QoL Boosts
Docker‑PHP v4.0.0‑beta1 introduces hardened FrankenPHP images, upgraded Laravel automation, a slew of fine‑grained environment variables, and numerous quality‑of‑life and bug‑fix improvements that make containerized PHP deployments smoother, more secure, and ready for production‑grade Kubernetes workloads.
Docker‑PHP v4.0.0‑beta1 Release Overview
This beta release adds substantial enhancements to the Docker‑PHP ecosystem, targeting production‑grade PHP container deployments with a focus on security, flexibility, and developer ergonomics.
FrankenPHP Image Enhancements
The core PHP runtime, FrankenPHP, now runs by default as the non‑privileged www-data user and listens on ports 8080 (HTTP) and 8443 (HTTPS), improving isolation for Kubernetes or other orchestrators. Health‑check endpoints are configurable via the $HEALTHCHECK_PATH environment variable, defaulting to /healthcheck (Caddy) but switchable to /up for Laravel. The bundled Caddyfile includes CloudFlare support, caching rules, security headers, flexible logging, and optional self‑signed certificate generation, assuming TLS termination occurs externally. Image tags follow the pattern {php-minor-version}-{variation}-{os-version} and now support Debian Trixie (13), Bookworm (12), and Alpine 3.22/3.21, giving users a choice of OS base.
Laravel Automation Script Upgrade
Laravel‑specific automation has been refactored. The default php artisan optimize command runs automatically when AUTORUN_LARAVEL_OPTIMIZE is true, preserving compatibility with the older AUTORUN_LARAVEL_ROUTE_CACHE flag. A new “migration mode” controlled by AUTORUN_LARAVEL_MIGRATION_MODE supports three strategies: default: standard forward migration ( php artisan migrate) fresh: drop all tables then migrate ( php artisan migrate:fresh) refresh: rollback and re‑run migrations ( php artisan migrate:refresh)
Additional flags let you target specific database connections (e.g., AUTORUN_LARAVEL_MIGRATION_DATABASE=mysql,pgsql ) and seed data ( AUTORUN_LARAVEL_MIGRATION_SEED=true ). Debug output can be enabled with AUTORUN_DEBUG=true for more verbose container logs.
New Environment Variables and NGINX Controls
Several PHP‑related variables allow fine‑tuning: PHP_OPCACHE_JIT=off – disables JIT by default PHP_MAX_INPUT_VARS=1000 – raises the input variable limit PHP_REALPATH_CACHE_TTL=120 – sets real‑path cache TTL
NGINX‑specific variables include: NGINX_LISTEN_IP_PROTOCOL=all (default IPv4/IPv6); set to ipv6 or ipv4 for single‑stack deployments NGINX_CLIENT_MAX_BODY_SIZE=100M – raises upload size limit
Other useful variables are PHP_FPM_PM_STATUS_PATH=/status for FPM status monitoring and AUTORUN_LARAVEL_MIGRATION_FORCE=true to force migrations.
Quality Improvements and Bug Fixes
Health‑check timing refined: start‑period 60 s, interval 3 s, timeout 3 s, retries 3, normal interval 10 s.
Entry‑point scripts now exit cleanly with exit 0, producing clearer startup logs.
File‑permission helper docker-php-serversideup-set-file-permissions now auto‑detects services and supports multiple directories via --dir.
Silent health‑check logs for fpm‑nginx and fpm‑apache variants prevent log flooding.
Session configuration deprecation warnings removed across all images.
S6‑based init script restored ( docker-serversideup-php-s6-init).
fpm‑nginx fixes: disabled absolute redirects, corrected Symfony asset SVGZ handling, and fixed Alpine permission notices.
fpm‑apache now logs Referer and User‑Agent headers. install-php-extensions updated to v2.9.11 for more stable dependency installation.
Conclusion
Although labeled beta, v4.0.0‑beta1 marks a significant step toward a production‑ready Docker‑PHP stack, offering tighter security, richer configurability, and smoother CI/CD pipelines. Users running PHP or Laravel in containers are encouraged to test the images (with backups) and provide feedback, while the project prepares for a stable v4 release targeting Kubernetes and broader cloud‑native environments.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Tech Hub
Sharing cutting-edge internet technologies and practical AI resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
