title: Docker containers unable to reach each other. Getting CONNECTION_REFUSED
body: <p>I am new to Docker but here's what I want to do. Have a create-react-app and node API server</p>
  <p>Both are different folders &quot;client&quot; and &quot;server&quot;.</p>
  <p>I have Dockerfiles for both and docker-compose.yml at the root of project.</p>
  <p>Now when I run docker-compose up and try to reach API server from React I get CONNECTION REFUSED  error.</p>
  <p>Can anyone help me on this ? React App is running on 3000 &amp; API Server is running on 9040</p>
  <p>Here are the DockerFiles and docker-compose files</p>
  <p><strong>Dockerfile of React</strong></p>
  <pre><code>FROM node:13.12.0-alpine
  
  WORKDIR /app
  
  COPY package*.json ./
  
  RUN yarn install
  
  COPY . .
  
  EXPOSE 8080
  
  EXPOSE 3000
  
  CMD [&quot;yarn&quot;, &quot;run&quot;, &quot;frontend&quot;]
  </code></pre>
  <p>Dockerfile of Node/Express API</p>
  <pre><code>FROM node:12
  
  WORKDIR /app
  
  COPY package*.json ./
  
  RUN yarn install
  
  COPY . .
  
  EXPOSE 9040
  
  CMD [&quot;yarn&quot;, &quot;run&quot;, &quot;backend&quot;]
  </code></pre>
  <p>Docker Compose file</p>
  <pre><code>version: &quot;3&quot;
  services:
    wt-client:
      image: sriram2207/wt-client
      stdin_open: true
      ports:
        - &quot;3000:3000&quot;
        - &quot;8080:8080&quot;
      networks:
        - wt-app
    wt-server:
      image: sriram2207/wt-server
      ports:
        - &quot;9040:9040&quot;
      networks:
        - wt-app
  networks:
    wt-app:
      driver: bridge
  </code></pre>
  <p>All I want to do is run both containers with one single command</p>