docker-php icon indicating copy to clipboard operation
docker-php copied to clipboard

Release v3.6

Open jaydrogers opened this issue 10 months ago • 10 comments

👨‍🔬 Test this PR

You can test the latest changes on our serversideup/php-dev repo on DockerHub:

serversideup/php-dev:523-*

(Any thing prefixed with 523 [the PR number] is built from this PR)

If you notice an issues, please open an issue on GitHub and specifically include the versions that you're having issues with.

🎯 Project Board

View the GitHub Project →

🤓 Docs Preview

View the latest docs →

⚡️ What's new

The following changes are available with this PR:

🌎 New Environment Variables

Environment Variable Default Authored By
AUTORUN_DEBUG false @jaydrogers
AUTORUN_LARAVEL_SEED false @DarkGhostHunter
AUTORUN_LARAVEL_MIGRATION_SKIP_DB_CHECK false @jaydrogers
PHP_FPM_PM_MAX_REQUESTS 0 @ifaridjalilov, @thueske
PHP_MAX_INPUT_VARS 1000 @RadeJR
PHP_OPCACHE_FORCE_RESTART_TIMEOUT 180 @aSeriousDeveloper, @jaydrogers
PHP_OPCACHE_JIT off @aSeriousDeveloper, @jaydrogers
PHP_OPCACHE_JIT_BUFFER_SIZE 0 @aSeriousDeveloper, @jaydrogers
PHP_OPCACHE_SAVE_COMMENTS 1 @aSeriousDeveloper, @jaydrogers
PHP_OPCACHE_VALIDATE_TIMESTAMPS 1 @aSeriousDeveloper, @jaydrogers

🤩 New Features

  • Added php artisan optimize support to the Laravel Automations script
  • Added php artisan db:seed support to the Laravel Automations script
  • Added AUTORUN_DEBUG environment variable to help diagnose issues with Laravel Automations
  • Refactored entire Laravel Automations script for better flexbility and user experience
  • Changed approach to executing entrypoint.d scripts so we can gracefully handle exit 0 in a entrypoint script
  • Re-designed container start up info script

🐛 Bug Fixes

  • Re-added docker-serversideup-php-s6-init back for advanced S6 dependency use cases (#479)
  • Fixed issue where Alpine images were the /run directory was not being changed when running docker-php-serversideup-set-file-permissions

⏫️ Upstream Dependencies

👨‍🔬 Tests to perform

Migrations

  • [x] Deploy a Laravel 12 app with isolated migrations using SQLite
  • [x] Deploy a migration that will fail, which should cause the container to exit
  • [x] Deploy a Laravel 7 app with AUTORUN_LARAVEL_OPTIMIZE=true and AUTORUN_LARAVEL_ROUTE_CACHE=false

Start Up Scripts

  • [x] Create a startup script with exit 0 -- the following scripts should continue
  • [x] Create a startup script with exit 1 -- the following container should exit
  • [x] Create a startup script with return 0 -- the following scripts should continue
  • [x] Create a startup script with return 1 -- the following container should exit
  • [x] A failed database connection on auto migration should cause the container to exit

jaydrogers avatar Mar 05 '25 20:03 jaydrogers

Deploying serversideup-php with  Cloudflare Pages  Cloudflare Pages

Latest commit: 62e8405
Status: ✅  Deploy successful!
Preview URL: https://7e2b9775.serversideup-php.pages.dev
Branch Preview URL: https://release-v3-6.serversideup-php.pages.dev

View logs

Any ETA for this Release? :)

twiesing avatar Apr 14 '25 18:04 twiesing

👨‍🔬 Test this PR

You can test the latest changes on our serversideup/php-dev repo on DockerHub:

serversideup/php-dev:523-*

(Any thing prefixed with 523 [the PR number] is built from this PR)

🤔 Plan for launch

@thueske: Any ETA for this Release? :)

I am testing this PRs with my client project as we're entering a QA round with them. I hope to have a beta in the next week or so then if everything is stable -- production launch after that 👍

I had some client projects that required a lot of attention recently. Good news is I have a build process if you want to test this PR already (see original comment or below):

❓ Hardcoded paths

@piotrpawelczyk: Paths are hardcoded in these scripts but can be overriden with ENV variables. Shouldn't that be taken into account?

Can you add comments where you're specifically talking about? I did a quick look and I see relative paths with the ENV

https://github.com/serversideup/docker-php/blob/f74e487cd750224d874038fd9587c025f69826ac/src/common/etc/entrypoint.d/50-laravel-automations.sh#L59

jaydrogers avatar Apr 18 '25 15:04 jaydrogers

Thanks @jaydrogers! Will test this PR-Image in my ~30 Client sites.

twiesing avatar Apr 18 '25 18:04 twiesing

Will test this PR-Image in my ~30 Client sites

I wouldn't call them "stable" yet, but it is working for one of our very complicated client testing sites:

  • Traefik
  • Laravel 12
  • Laravel Horizon
  • Laravel Scheduler
  • Laravel Reverb
  • Meilisearch
  • serversideup/docker-ssh
  • Redis
  • MariaDB

jaydrogers avatar Apr 18 '25 18:04 jaydrogers

The “PHP_FPM_PM_MAX_REQUESTS” is an important one.

This is not related to this image itself, but I have noticed a kind of memory leak on recent versions of PHP. Not sure if some extensions cause this problem. Probably opcache.

The red line on this chart, uses the 3.5 fpm-ngix version.

This site has ZERO visitors , and the memory increases overtime just because of a one minute ping for uptime check.

image

This can be reproduced by using a stress test tool like “ab” or similar one. Just run for a few seconds and stop it, then again and stop it. The memory never goes back to the original value , it always increases. Even after the extra children process are killed.

robsontenorio avatar May 14 '25 14:05 robsontenorio

That's super strange! I've been running this in very low spec servers and haven't noticed any issues. Some of them are even stacked with multiple apps on them (using our PHP image).

Have you noticed any improvements with what I have in this release so far?

You can test the latest changes on our serversideup/php-dev repo on DockerHub:

serversideup/php-dev:523-*

jaydrogers avatar May 14 '25 14:05 jaydrogers

@jaydrogers

I will try 3.6.

But , for reference here is how I extend the 3.5. I can’t see what would be wrong.

https://github.com/robsontenorio/laravel-docker/blob/sideup/Dockerfile

Make sure to use the “sideup” branch.

robsontenorio avatar May 14 '25 14:05 robsontenorio

@robsontenorio are you using OpCache with JIT (tracing) enabled? Had some segfaults & other Problems with it since PHP 8.4. After disabling JIT, it works.

twiesing avatar May 14 '25 14:05 twiesing

@thueske @jaydrogers

I didn’t touch JIT and use all default configs from this image (3.5). Just enabled opcache. As you can see on my previous coment (link to Dockerfile).

EDIT:

As a follow-up, I identified the problem. It was related to Livewire (Volt) due to the usage of certain opcache functions within its codebase.

robsontenorio avatar May 14 '25 14:05 robsontenorio

Hey @jaydrogers, could you please take a look at #534? It's a simple and useful addition for this upcoming v4.0 release.

robsontenorio avatar Aug 26 '25 15:08 robsontenorio

⚠️ Important update

This PR is being closed in favor of #283.

I played GitHub Shuffle and I had to do another release before this release. I also worked on FrankenPHP and got super far. So long story short, use this PR below for testing these features 😃

  • https://github.com/serversideup/docker-php/pull/283

I took all these commits and moved them over there manually 🤓

jaydrogers avatar Aug 28 '25 21:08 jaydrogers