I have docker image that pass environments to container
environment:
MYSQL_USER: ${MYSQL_USER:-mysql}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-mysql}
MYSQL_DATABASE: ${MYSQL_DATABASE:-test}
They are in container
$ printenv
HOSTNAME=cd5041be5b83
PWD=/
MYSQL_PASSWORD=mysql
MYSQL_USER=mysql
HOME=/root
MYSQL_DATABASE=test
Apache config
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName localhost
DocumentRoot "/app/code"
ErrorLog /app/log/error.log
CustomLog /app/log/requests.log combined
PassEnv MYSQL_USER MYSQL_PASSWORD
<Directory "/app/code">
AllowOverride All
</Directory>
</VirtualHost>
But when I try to get them they not exist in
var_dump(getenv());
var_dump($_ENV);
var_dump($_SERVER);