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:

  • Docker difference between Dockerfile VOLUME and docker run -v command
  • datapower cannot be installed in docker
  • On server startup NPM find start script
  • Kubernetes executor on Gitlab ERROR: Job failed: image pull failed
  • Docker: save internal hd contents
  • GitLab-CI Multi Runner php composer cache
  • services:
        my-website:
            env_file: my-website.env
            build: .
            expose:
                - "80"
            volumes:
                - .:/app
    

    The environment variables file is:

    SYMFONY__ENV__SECRET=1234567890
    ...
    

    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!

  • docker connecting to host tunnel from container
  • Delete an image, docker-compose cannot work
  • Why does building from a docker file take up all the disk space?
  • How to check if docker machine exists programmatically?
  • Jupyter kernel dead
  • Docker Compose not updating content
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.