mirror of
https://github.com/linuxserver/docker-grocy.git
synced 2026-02-20 02:13:13 +08:00
Make php-fpm forward environment variables
By default php-fpm has `clear_env` option activated. This means that environment variables never will be passed on from the system environment to the actual worker process for a given request. This also means that Grocy will not be configureable via Environment variables. Which is very common behaviour. We can fix this by disabling the `clear_env`. You can test that it works by for example changing the currency via an environment variable: docker run -e GROCY_CURRENCY=NOK -p 8080:80 linuxserver/grocy:latest Then opening: http://localhost:8080/stockoverview And verifying that the app allows you to change the setting. There's more info on how Grocy handles configuration, here: https://github.com/grocy/grocy/blob/master/config-dist.php#L3
This commit is contained in:
parent
1031528013
commit
b0f407bab5
@ -22,6 +22,9 @@ RUN \
|
||||
php83-pdo \
|
||||
php83-pdo_sqlite \
|
||||
php83-tokenizer && \
|
||||
echo "**** configure php-fpm to pass env vars ****" && \
|
||||
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php83/php-fpm.d/www.conf && \
|
||||
grep -qxF 'clear_env = no' /etc/php83/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php83/php-fpm.d/www.conf && \
|
||||
echo "**** install grocy ****" && \
|
||||
mkdir -p /app/www && \
|
||||
if [ -z ${GROCY_RELEASE+x} ]; then \
|
||||
|
||||
@ -22,6 +22,9 @@ RUN \
|
||||
php83-pdo \
|
||||
php83-pdo_sqlite \
|
||||
php83-tokenizer && \
|
||||
echo "**** configure php-fpm to pass env vars ****" && \
|
||||
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php83/php-fpm.d/www.conf && \
|
||||
grep -qxF 'clear_env = no' /etc/php83/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php83/php-fpm.d/www.conf && \
|
||||
echo "**** install grocy ****" && \
|
||||
mkdir -p /app/www && \
|
||||
if [ -z ${GROCY_RELEASE+x} ]; then \
|
||||
|
||||
@ -41,6 +41,7 @@ app_setup_block: |
|
||||
|
||||
# changelog
|
||||
changelogs:
|
||||
- { date: "29.03.24:", desc: "Add `clear_env = no` to `php-fpm` to pass on environment variables to workers threads" }
|
||||
- { date: "06.03.24:", desc: "Existing users should update: site-confs/default.conf - Cleanup default site conf." }
|
||||
- { date: "06.03.24:", desc: "Rebase to Alpine 3.19 with php 8.3."}
|
||||
- { date: "25.05.23:", desc: "Rebase to Alpine 3.18, deprecate armhf." }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user