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:

  • how to export VM (VirtualBox) to tgz archive?
  • how to connect Docker containers without a bridge?
  • Node-inspector in docker does not load sources
  • docker build step plugin inside jenkins docker container
  • docker with device-mapper and luks
  • No connection to generic driver
  • 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!

  • Apache in Docker won't deliver sites
  • Kubernetes. HTTPS API return `Unauthorized`
  • How to store MongoDB data with docker-compose
  • Docker Compose - Flyway - Unable to obtain Jdbc connection from DataSource
  • Docker - exposing IP addresses to DNS server
  • How to set up executor IPs inside Docker containers?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.