Closed psy0rz closed 2 years ago
I fiddled around a bit: First you have to set S6_KEEP_ENV=1 via docker.
Then you need to adjust both php.ini and the www php-fpm config file to allow environment variables. Maybe there's an official way for it?
Allowing PHP to retain envs isn't too difficult a change, we can certainly look to do it. S6_KEEP_ENV shouldn't be required as the nginx service is run with contenv which passes the container environment to it.
No, php needs the environment variables, not nginx?
php is also run with contenv so it has access to the vars
But like spad said, php by default ignores the system env vars. There is a flag you need to add to the php-local.ini so it doesn't ignore them
Could you perhaps add an option for that as well?
Can you please test with lspipepr/grav:1.7.35-pkg-9023161a-pr-18
and see if it works as desired.
uuh..whats the full image-url i put in my compose file?
That is the image repo/name.
thanks, that works! grav/php now sees the variable.
I'm not sure when grav decides to create an actual environment. (on my production server it does, somehow, and on my test it never does) But thats a grav-thing, so i'll figure that out.
Thanks!
PR is merged so once it's built in ~30 minutes you can switch back to the "normal" image again.
very nice, i love linuxserver images :)
As per documentation, this variable is used for multi site setup: https://learn.getgrav.org/17/advanced/multisite-setup
Since its probably filtered somewhere, grav will fall back to the default environment which is based on the visited domain. This has unintended consquences.