Open joshmanders opened 2 months ago
You must use the cli variant, not nginx
I could see some people liking to use the same base image for all services. There are some new things that I learned that we can bypass S6 from executing. Stay tuned π
I'll get to this soon π
@jaydrogers
I could see some people liking to use the same base image for all services. There are some new things that I learned that we can bypass S6 from executing. Stay tuned π
I'll get to this soon π
Yeah honestly I switched away from this docker image because it complicates my deployment to require 2 separate images and builds to produce a k8s pod for running the web app and queue and schedulers.
@joshmanders: You shouldn't need two separate images at all.
I like to use one base image (like serversideup/php:8.3-fpm-nginx
), then I build my entire application to publish myorg/myapp
.
The docs then suggest using three separate processes (following the Docker Philosophy of "do one thing well").
The trick with NGINX being in there with S6 Overlay is S6 Overlay wants to demand PID 1. This is where you're getting the extra processes with your original post.
To workaround that, we can just override the entrypoint for a Queue, Scheduler, Horizon, etc then S6 Overlay won't initialize its own PID to supervise anything else. Everything will come from a single base image of myorg/myapp
when it runs.
I'll have more documentation on this approach soon.
@joshmanders: You shouldn't need two separate images at all.
I like to use one base image (like
serversideup/php:8.3-fpm-nginx
), then I build my entire application to publishmyorg/myapp
.The docs then suggest using three separate processes (following the Docker Philosophy of "do one thing well").
The trick with NGINX being in there with S6 Overlay is S6 Overlay wants to demand PID 1. This is where you're getting the extra processes with your original post.
To workaround that, we can just override the entrypoint for a Queue, Scheduler, Horizon, etc then S6 Overlay won't initialize its own PID to supervise anything else. Everything will come from a single base image of
myorg/myapp
when it runs.I'll have more documentation on this approach soon.
Basically you are changing dynamically the entrypoint according to the application type?
I wouldn't call it "dynamic" as that seems automatic.
In short terms, I am statically disabling S6 overlay only on services that don't need S6 Overlay (anything that doesn't need a web server).
This gives me the strategy of keeping one image as my source of truth, but also reducing footprint in my other services while getting it close to the "single process per container" approach as Docker strives for.
It's just with PHP-FPM + NGINX is where things get weird (hence the point of why I started this project π)
I'll have more documentation on this approach soon.
Yes please, seems a lot of usefulness is missing in the docs. I tried for days to make this work before submitting this issue, then tried for days again before I found it was easier to just replace it with a custom dockerfile using FrankenPHP and went that route.
Affected Docker Images
Current Behavior
Following this guide on running Laravel Task Scheduler it says to just call use this command
command: ["php", "/var/www/html/artisan", "schedule:work"]
and it should work. I ran a test command into Docker as justphp artisan
to get alternative output, and this was the result.Expected Behavior
When not running the default command, the only output that should be is the command output not output that nginx is booted up and accepting (and receiving ping/status requests internally).
Steps To Reproduce
serversideup/php:8.3.6-fpm-nginx-alpine
as a basedocker run ...
and pass a command off to override the built in one per instructions in docsAnything else?
No response