I was reading the documentation on Docker hub and came across the:
Configuration This image ships with the default
php.ini-development
andphp.ini-production
configuration files. It is strongly recommended to use the production config for images used in production environments! I followed the steps to use them by adding the following in myDockerfile.dev
:
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
Or
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
Now when I start my cluster, all of the environmental variables it uses in the index.php
say Undefined Index
and the program no longer works. The fix is to comment out RUN mv...
and then everything works again.
Why would it be breaking the Kubernetes environmental variables and how can I get them to work in conjunction?
Seems like switch from fetching environmental variables with $_ENV['<varname>']
to getenv('<varname>')
fixed the issue.