Retain environment variable values for Symfony2 app development in Docker
I have a Symfony2 app running inside Docker container. The parameters.yml file is set to pick environment variables as following:
framework: secret: "%env.secret%" ...
The Docker compose file contents are:
services: my-website: env_file: my-website.env build: . expose: - "80" volumes: - .:/app
The environment variables file is:
Everything works fine when accessed via “app.php“. However when accessed in dev mode (via app_dev.php) it fails to pick the environment variables. Is there any way to use the environment variables? I do not want to create another parameters.yml file with hardcoded values. Than you!