title: docker-compose environment variables used as path for volumes don't get resolved
body: <p>Docker version (latest for Mac)</p>
  
  <pre><code>Version 17.03.1-ce-mac5 (16048)
  </code></pre>
  
  <p>I'm trying to externalise the paths so each developer can change a single file to map components to the right path in their local environment. For example where nginx servers a static website.</p>
  
  <pre><code>#localhost.env
  INDEX_PATH=/Users/felipe/website/public
  </code></pre>
  
  <p>This is my compose.yml</p>
  
  <pre><code> nginx:
      image: nginx
      ports:
      - "8081:8081"
      volumes:
       - ${INDEX_PATH}:/etc/nginx/html:ro
      env_file:
        - ./localhost.env
  </code></pre>
  
  <p>In short, I define the <em>INDEX_PATH</em> variable to point to my local path and I want nginx to serve the website from there. Another developer should then set </p>
  
  <pre><code>#localhost.env
  INDEX_PATH=/Users/somebodyElse/whatever/public
  </code></pre>
  
  <h1>The problem</h1>
  
  <p>For some reason that I don't understand the local variable somehow does not get resolved properly, at least when using it <strong>as volume's path</strong> .</p>
  
  <h1>Testing</h1>
  
  <p>docker-compose config </p>
  
  <pre><code>nginx:
      environment:
        INDEX_PATH: /Users/felipe/website/public
      image: nginx
      ports:
      - 8081:8081
      volumes:
      - .:/etc/nginx/html:ro   //HERE I WAS EXPECTING THE PATH
  </code></pre>
  
  <p>As you can see, it just get resolved as <strong>.</strong> (a dot instead of the path /Users/felipe/website/public)</p>
  
  <p>Any idea what I'm doing wrong? I believe this feature is supported but can't work out how to do it.</p>
  
  <p>Thank you!</p>