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:

  • Script run inside docker container reporting significantly higher memory than outside
  • How to read and write to mounted volume without running as root?
  • Which way is faster when access a service in docker container?
  • Is it safe to export tarball of running docker container?
  • Running out of inodes on a docker volume
  • Why does `docker images` also show the base image?
  • 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!

  • Sidekiq Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED) on docker-compose
  • DOCKER_OPTS in Docker container 1.9.1-dind
  • Can docker run additional libraries my OS doesnt support?
  • How can I link files in Dockerfile?
  • How can I know why Docker container stopped?
  • What run flags are included in my Docker Container
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.