title: How to use environment variables inside docker .env file?
body: <p>I have a cache folder and the path is stored in an evironment variable: <code>$LOCAL_CACHE (export LOCAL_CACHE=/home/me/path/to/any/cache/folder)</code></p>
  
  <p>Now I want to append some additional folders inside my .env file:</p>
  
  <p>My .env file:</p>
  
  <pre><code>LOCAL_COMPOSER_DIR=${LOCAL_CACHE}/composer
  LOCAL_NPM_DIR=${LOCAL_CACHE}/npm
  LOCAL_BOWER_DIR=${LOCAL_CACHE}/bower
  </code></pre>
  
  <p>My docker_compose.yml looks like that:</p>
  
  <pre><code>version: '2'
  services:
    composer:
      env_file: .env
      image: composer/composer
      volumes:
        - ./src:${APP_ROOT}
        - ${LOCAL_COMPOSER_DIR}:/composer
      working_dir: ${APP_ROOT}
  </code></pre>
  
  <p>When I start the service with <code>docker-compose run composer instal. ...</code> it stops with following error: <code>ERROR: Named volume "$LOCAL_CACHE"/composer":/composer:rw" is used in service "composer" but no declaration was found in the volumes section.</code></p>
  
  <p>I'm not shure but it seems, the .env file doesn't support the use of variables.</p>