Closed PascaleBeier closed 1 month ago
@dunglas could you give your 2 cents here? Thanks!
The FrankenPHP process started by Symfony Process inherits env vars defined in the system. I didn't try, but calling putenv('FOO=BAR')
should be enough to pass FOO
to FrankenPHP.
That being said, I'm +1 to add an extension point allowing users to customize env vars passed to FrankenPHP.
Thanks @dunglas. In that regard @PascaleBeier we'd appreciate a PR we could have a look at, thanks.
Problem
We are deploying FrankenPHP + Octane and use a custom Caddyfile to proxy the Reverb Server and provide additional Caddy Modules and configuration.
Currently, the frankenphp runtime is hardcoded and limited to these environment variables:
src/Commands/StartFrankenPhpCommand.php
Due to the vast amount of flexibilty and usecases the FrankenPHP variant provides, I think it would be helpful to allow integrators a way to manipulate or hook into these environment variables, maybe even just by moving these to a dedicated method.
Example
To extend Caddy, we incoorperate the Octane Caddyfile into our own along these lines:
This is a straightforward way to proxy REVERB given the known environment variables that are already present in the container.
To work around this, we currently have to provide our own
octane:frankenphp
Command, here asapp:start
I wonder what you or @dunglas advise in this situation, since our hacky solution is not really something we love.