serversideup / docker-php

🐳 Production-ready Docker images for PHP. Optimized for Laravel, WordPress, and more!
https://serversideup.net/open-source/docker-php/
GNU General Public License v3.0
1.6k stars 107 forks source link

Create an NGINX Unit Variation #235

Closed jaydrogers closed 5 days ago

jaydrogers commented 7 months ago

Discussed in https://github.com/serversideup/docker-php/discussions/206

Originally posted by **jaydrogers** September 12, 2023 # 👉 Describe the problem [comment]: <> (What are you trying to solve?) - 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](https://unit.nginx.org/) is a new project that could replace PHP-FPM & S6 Overlay all together # 🏆 How to solve this problem [comment]: <> (Describe the feature that you are proposing and how it will solve the 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? [comment]: <> (Explain use cases on how we can measure the success of this implementation) - [x] 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)
CoolGoose commented 1 month ago

👋 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.

jaydrogers commented 1 month ago

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!

lukevear commented 1 week ago

FYI, we've been running the Unit variation on AWS Fargate since late May without issue for number of Laravel & non-laravel applications.