title: How to access linked docker container's host with react
body: <p>My application has three containers: db, frontend-web(React), backend-api
  How can I get my backend-api address in frontend-web</p>
  
  <p>Here is my compose file</p>
  
  <pre><code>version: '2'
  services:
    db:
      image: postgres
    ports:
      - "5432:5432"
  
    web:
      build: .
      stdin_open: true
      volumes:
        - .:/usr/src/app
      ports:
        - "3000:3000"
      environment:
        - API_URL=http://api:8080/
      links:
        - api
      depends_on:
        - api
  
    api:
      build: ./api
      stdin_open: true
      volumes:
        - ./api:/usr/src/app
      ports:
        - "8080:3000"
      links:
        - db
      depends_on:
        - db
  </code></pre>
  
  <p>I can't get the address both api and process.env.API_URL</p>