title: Fetching data from couch db database in docker using Angular 4 Application
body: <p>I have a UI application which is developed in Angular 4. I also have a service Super login and database couch db. I am making a request from Angular 4 application to couch db with alias name as couchdb:5984 and the status of the request is failed (failed) net:ERR_CONNECTION_REFUSED</p>
  
  <p>repo: <a href="https://github.com/janastu/iihs_couch_services" rel="nofollow noreferrer">https://github.com/janastu/iihs_couch_services</a></p>
  
  <p>Below is my docker-compose.yml</p>
  
  <pre><code>version: '2'
  volumes:
  couchdb_data: {}
  services:
  # Build the container using the client Dockerfile
  client:
  build: ./client
    # This line maps the contents of the client folder into the container.
  ports:
    - "80:80"
  links:
    - superlogin:superlogin
    - couchdb:couchdb  
  couchdb:
  environment:
  - COUCHDB_USER:somename
   - COUCHDB_PASSWORD:somepassword
  volumes:
   - ./client:/usr/src/app
  
  # Build the container using the superlogin Dockerfile
  superlogin:
  build: ./superlogin&gt;    ports:
  - "3000:3000"
  # Link the client container so that Nginx will have access to it
  links:
  - couchdb:couchdb
  couchdb:
  environment:
  - COUCHDB_USER:somename
  - COUCHDB_PASSWORD:somepassword
  image: klaemo/couchdb:1.6-couchperuser
  ports:
  - "5984:5984"
  volumes:
  - "couchdb_data:/usr/local/var/lib/couchdb"
  </code></pre>
  
  <p>All the containers are up and running.
  How to access the database from the container couch db from angular 4 application? </p>
  
  <p><a href="https://i.stack.imgur.com/7pjaC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7pjaC.png" alt="Screen shot after doing docker-compose up"></a></p>