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:

  • Sign-in Sign-up form with Node+MySql Docker Container
  • Docker daemon not starting after adding the -H flag
  • Running IBM DOORS in a docker container
  • Best way to use mysql for docker based microservices
  • Docker - is it necessary to push images to remote server?
  • Docker commands via php shell_exec
  • 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!

  • Debian Packagemanager won't install vagrant.deb package on alpine-linux, while building docker image
  • Boot2docker proxy on windows
  • Docker build project from Docker Hub
  • Setting up our own private docker hub
  • Switching users inside Docker image to a non-root user
  • PULL Docker container/image
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.