This is what I have in my .yml:
version: '2' services: ## Wordpress Container wordpress: ... ## MySql mysql: ... ## Nginx Container nginx: container_name: afp_nginx image: ng:afp environment: PHP_FPM_SOCK: wordpress:9000 SERVER_NAME: wordpress.dev ENV: stage ports: - 8080:80 volumes: - ./x_wordpress:/var/www/html - ./x_nginx/ssl:/etc/nginx/ssl ## Composer Container composer: ...
When I console.log(process.env.ENV)
I get undefined.
When I var_dump($_ENV)
my variable ENV is not defined either.
However, when I run $ docker exec afp_nginx printenv ENV
I get the correct output 'stage'.
How do I access the value of ENV inside my application (in a javascript file, or in PHP)?
Should it be declared in composer instead of nginx, or somewhere else?
Thanks