v4.0.0-beta #569
Replies: 5 comments 16 replies
-
|
Yay! Time to test! Is there a local development version for this, with the idea of having 1:1 reproduction on production? |
Beta Was this translation helpful? Give feedback.
-
|
Is it possible to have http health checks for workers? |
Beta Was this translation helpful? Give feedback.
-
|
@jaydrogers this is a stupid question but are there docs on how to run this, i.e. the Franken php version vs the normal version? |
Beta Was this translation helpful? Give feedback.
-
Q: Enable OPcache by default?At a recent PHP conference, I had a chat with somebody from tideways about your base image and the fact that you disable OPcache by default, to "to keep developers sane". He was curious about why this was considered the safe bet, given that OPcache can apparently be configured in a way to be rather safe for development. If this would generally be the case, I wonder if enabling OPcache by default would be a sane way forward.
For any unpredictable, esoteric cases, there could still be a clear warning (recommendation?) that OPcache could be disabled for development. I have not done extensive research, but at a glance, it looks indeed as if OPcache can be configured in a way that is safe for development. With the help of ChatGPT and the PHP docs, here's an example config that seems sensible: ; Enable opcache
opcache.enable=1
opcache.enable_cli=1
; Always see code changes immediately
opcache.validate_timestamps=1
opcache.revalidate_freq=0 ; check mtime every request
opcache.revalidate_path=1 ; follow realpath changes
; Avoid “just edited but not seen” delays
opcache.file_update_protection=0 ; no grace period after file writes
; Disable persistence that can survive process restarts
opcache.file_cache_only=0
opcache.file_cache=
; Keep attributes available for frameworks/annotations
opcache.save_comments=1 |
Beta Was this translation helpful? Give feedback.
-
|
I believe Opcache options should have three switches: Completely On (for production), Partially On (for staging or previews), Off (for local development). |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
🌎 Latest Documentation
Use the link below to reference the latest documentation (it will automatically update as we keep improving the docs).
View the latest documentation →
🐳 How to find the beta images
Anything tagged with
betawill reference the latest beta release and should be tested.View Beta Images on Dockerhub →
⚡️ What's new
🧟♂️ FrankenPHP variations now added
The highly anticipated release of FrankenPHP is now available. These images come with many enhancements compared to the official FrankenPHP images.
Images are unprivileged by default
For best security practices, we're running things as
www-data. This dramatically reduces your security footprint when running PHP in production. Because of this, we're listening on8080 (HTTP)and8443 (HTTPS). This follows the same design pattern as our other images.Native health checks
Health checks are critical for ensureing zero-downtime deployments. Our images come "batteries included" with intelligent health check endpoints that can easily be customized with
$HEALTHCHECK_PATH. By default, our images ensure/healthcheckis alive with Caddy, but you can change this variable toHEALTHCHECK_PATH=/upand it will use the built-in Laravel health check endpoint to ensure Laravel is actually ready to accept requests.Extremely flexible and production-grade Caddyfile by default
The default FrankenPHP Caddyfile gives you enough to get started, but we spent a ton of time making sure that we're shipping production-grade and secure configurations by default. This includes:
Designed for mass-scale production deployments
It's almost unbelievable and amazing how well FrankenPHP works with Caddy as a proxy. This tight integration allows you to do magical things like deploy trusted SSLs with Let's Encrypt. The only problem is, you probably have something else serving SSL termination and you most likely would not use that feature in a single container.
Our approach is "orchestrator first", meaning the image is designed for mass-scale in mind.
This means we're shipping the image assuming that you're doing TLS termination elsewhere. This makes it easier for you to scale and perform zero-downtime deployments:
flowchart TD A["Reverse Proxy (Not FrankenPHP)"] -->C{Container Service} C -->|STOP| D[MyApp:v1] C -->|START| E[MyApp:v2]Flexible environment configuration
Just like the experience with our other PHP variations, we also have things like
SSL_MODE,LOG_OUTPUT_LEVEL, changing PHP INI settings with environment variables, all our helper scripts for changing permissions, etc. that make it a breeze for you to customize how the PHP image behaves.More operating system variations
We are able to compile FrankenPHP by source, which allows us to open up support for many operating systems.
How tagging works
There's more to it, but in general the primary principle is:
{php-minor-version}-{variation}-{os-version}This means we're offering FrankenPHP with the following operating systems:
trixie: Debian Trixie (13)bookworm: Debian Bookworm (12)alpine3.22: Alpine 3.22alpine3.21: Alpine 3.21🌎 New Environment Variables
The following environment variables are now available:
default/dev/stdout100M/dev/stderrall/status0120nullOff🤩 New Features
Laravel Automations Script Improvements
The Laravel Automations script has been completely refactored to make it easier to support advanced Laravel features. Tons of new features are now available:
"php artisan optmize" now run by default
Instead of setting
AUTORUN_LARAVEL_ROUTE_CACHE,AUTORUN_LARAVEL_VIEW_CACHEetc, we useAUTORUN_LARAVEL_OPTIMIZEby default, which callsphp artisan optimize. Readjusting our logic to this new structure not only simplifies our approach to follow Laravel's best practices, it allows you to hook into the optimize command if you need to use it for your own application.If you don't want to use
php artisan optimizeor if you're running an older version of Laravel, no sweat! Our refactored approach is backwards compatible and you can enable/disable certain functions by just setting your desired values toAUTORUN_LARAVEL_ROUTE_CACHE,AUTORUN_LARAVEL_VIEW_CACHEetc.Added support for "migration modes"
We now support different migration modes of
refreshorfreshby Laravel. This is super helpful if you need to seed a preview environment.default(our default behavior)php artisan migrate- standard forward migrationsfreshphp artisan migrate:fresh- drops all tables and re-runs migrationsrefreshphp artisan migrate:refresh- rolls back and re-runs migrationsSpecify which database connections to run migrations with
If you run multiple databases with a multi-tenant Laravel application, you may need to specify your exact database connection that you'd like to use. We created
AUTORUN_LARAVEL_MIGRATION_DATABASEso you can set the configuration name of the database connection you'd like to run migrations on (ie.mysql). Supports running against multiple databases too (ie.mysql,pgsql).Added "--seed" option to migrations
Laravel has a helpful flag of
--seedthat you can run with php artisan migrate that will indicate if the seed task should be re-run. If you need this, just setAUTORUN_LARAVEL_MIGRATION_SEEDtotrue.Easier debugging
If you're running into issues with automations, set
AUTORUN_DEBUGtotrueand you'll get helpful output to help you figure out why you're running into issues.Control NGINX IP listening protocols with
NGINX_LISTEN_IP_PROTOCOLAre you running an IPv6 only cluster with fpm-nginx? Now you can set
NGINX_LISTEN_IP_PROTOCOL: ipv6and NGINX will listen on IPv6 stacks only. Same thing works if you set it toipv4, then IPv6 will be disabled.Great for Kubernetes clusters! 🤓
Default behavior is to keep a non-breaking change of
allwhich will listen on IPv4 and IPv6.🧘♂️ Quality Of Life Improvements
Improved health checks
A brilliant PR by @aSeriousDeveloper was merged which dramatically improves our "definition of healthy", especially on container start up. This approach utilizes
start-periodandstart-intervalwhich will give us more accurate readings and flexibility for container start up.unhealthy.Startup and Entrypoint Scripts
entrypoint.dscripts so we can gracefully handleexit 0in a entrypoint scriptChanging file permissions (
docker-php-serversideup-set-file-permissions)--serviceis now optional)--dirparameter for specifying extra directories (you can specify multiple--dirflags for multiple directories)Quiet health check access logs
fpm-nginxandfpm-apachelogs to never show access log output for any request$HEALTHCHECK_PATH. Things are much quieter now 😃🐛 Bug Fixes
All images
session.sid_bits_per_characterandsession.sid_length(using PHP defaults now) (session.sid_bits_per_character INI setting is deprecated & session.sid_length INI setting is deprecated #560)S6-based images (
fpm-nginxandfpm-apache)docker-serversideup-php-s6-initback for advanced S6 dependency use cases (Custom s6 services dependencies no longer works #479)fpm-nginx
absolute_redirect off;to have redirects return relative redirects (helpful for proxies like Traefik) (Add absolute_redirect off; to prevent broken redirects in containerized environments #567)svgzwith Symphony's asset mapper with FPM-NGINX (Move SVG handling to media assets block for Symfony's Asset Mapper compatibility #530)/package/admin/s6-overlay/libexec/preinit: info: /run belongs to uid X instead of Ywhen using thedocker-php-serversideup-set-file-permisisonsscript on FPM-NGINX Alpine instancesfpm-apache
⏫ Dependency updates
install-php-extensionsscript to v2.9.11What's Changed
NGINX_ACCESS_LOGandNGINX_ERROR_LOGby @robsontenorio in AddNGINX_ACCESS_LOGandNGINX_ERROR_LOG#534NGINX_IP_LISTENING_PROTOCOLby @yuuzukatsu in FEAT: addNGINX_IP_LISTENING_PROTOCOL#539client_max_body_sizeto be configurable by @dlundgren in feat: allow nginxclient_max_body_sizeto be configurable #558New Contributors
NGINX_ACCESS_LOGandNGINX_ERROR_LOG#534NGINX_IP_LISTENING_PROTOCOL#539client_max_body_sizeto be configurable #558Full Changelog: v3.6.1...v4.0.0-beta1
This discussion was created from the release v4.0.0-beta1.
Beta Was this translation helpful? Give feedback.
All reactions