title: Use docker-compose service names in Nginx config
body: <p>I have an application with 4 services. One of them is Nginx which will act as a proxy. 
  I use docker compose to run the services. In nginx when I specify a path and where to proxy I want to be able to use the service name. This is what I have done so far.</p>
  
  <pre><code>version: '3'
  services:
    go_app:
      image: go_app
      depends_on: 
        - mysql
      ports: 
        - "8000:8000"
  
    mysql:
      image: mysql_db
      ports: 
        - "3306:3306"
  
    flask_app:
      image: flask_app
      ports: 
        - "8080:8080"
  
    nginx:
      image: nginx_app
      ports: 
        - "80:80"
      depends_on: 
        - mysql
        - flask_app
        - go_app
  </code></pre>
  
  <p>With the above I create all services. They all work on their respective ports. I want Nginx to listen on port 80 and proxy as defined in the config:</p>
  
  <pre><code>server {
  listen 0.0.0.0:80;
  server_name localhost;
  
  location / {
    proxy_pass http://${FLASK_APP}:8080/;
    }
  }
  </code></pre>
  
  <p>You may ask where does FLASK_APP come from. I specify it inside nginx docker image:</p>
  
  <pre><code>FROM nginx
  
  ENV FLASK_APP=flask_app
  RUN rm /etc/nginx/conf.d/default.conf
  COPY config/default.conf /etc/nginx/conf.d/default.conf
  EXPOSE 80
  CMD ["nginx", "-g", "daemon off;"]
  </code></pre>
  
  <p>Nginx container keeps failing with the following error:</p>
  
  <pre><code>[emerg] 1#1: unknown "flask_app" variable
  nginx: [emerg] unknown "flask_app" variable
  </code></pre>
  
  <p>The way I understand docker compose, <code>flask_app</code> should resolve as the flask_app service.
  What am I doing wrong/misunderstanding?</p>