Create an NGINX Unit Variation
Discussed in https://github.com/serversideup/docker-php/discussions/206
Originally posted by jaydrogers September 12, 2023
👉 Describe the problem
- PHP-FPM is quite dated and not optimized for running in containers, so people use Supervisor but that isn't always truthful on container health
- S6 Overlay is the answer to Supervisor, but it doesn't have the best host compatibility
- NGINX Unit is a new project that could replace PHP-FPM & S6 Overlay all together
🏆 How to solve this problem
Remove S6 Overlay
- [x] See if we can get the container to run without using S6 Overlay
Configure NGINX Unit to run PHP
- [x] NGINX Unit should run PHP without needing S6 Overlay or Supervisor
- [x] Container health should accurately be reported
Resources: There is a fantastic video by Chris Fidao on this subject: https://www.youtube.com/watch?v=-ek0-mLZDbo
💯 How do we validate the problem is solved?
- [ ] Users can run this new variation on hosts like Fly.io
- [x] Users can execute our Laravel Automations script (like we currently have with our images)
👋 we're going to prepare a migration to docker and since we're running in k8s (and s6 overlay and gke don't love each other) we're going to most likely try this flow.
Anything I can help with 'validating this' ? Just starting Laravel as a PoC worked with no issues.
Thanks! I am pretty confident in the Unit configuration, I just left this open so I can verify this on other hosts. I just haven't had time to swing back.
If you can confirm it runs on Fly.io, then I could close this.
Let me know if you run into any issues, thanks!
FYI, we've been running the Unit variation on AWS Fargate since late May without issue for number of Laravel & non-laravel applications.