title: Unable to communicate between docker containers on localhost
body: <p>First, I am new to docker containers, I don't know much about how they are running, but I have this setup:</p>
  
  <ul>
  <li>One docker container for a .NET Core API (Docker File autogenerated by VS-2019)</li>
  <li>One docker container for an Angular 9 application</li>
  </ul>
  
  <p>The API is reachable at <a href="https://localhost:44384/api/weatherforecast" rel="nofollow noreferrer">https://localhost:44384/api/weatherforecast</a>
  The containerized angular app is reachable at <a href="https://localhost:4200" rel="nofollow noreferrer">https://localhost:4200</a></p>
  
  <p>If I am running the angular app without docker, after fixing the CORS issues with a proxy, I am able to connect to <a href="https://localhost:44384/api/weatherforecast" rel="nofollow noreferrer">https://localhost:44384/api/weatherforecast</a>. However, when I am running the dockerized version I am receiving the following error:</p>
  
  <pre><code>Failed to load resource: the server responded with a status of 504 (Gateway Timeout)
  </code></pre>
  
  <p>In the VS Console I see this error:</p>
  
  <pre><code>clearance_1  | [HPM] Error occurred while trying to proxy request /api/weatherforecast from loccoalhost:4200 to https://localhost:44384 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
  </code></pre>
  
  <p>It seems to be a connectivity issue, so I dig a bit on the internet and I tried to bring these two containers under the same network.</p>
  
  <p>Here are the steps: 
  1. Create a bridge "test" network</p>
  
  <pre><code>docker network create test
  </code></pre>
  
  <ol start="2">
  <li>Connect both containers to the newly created network:</li>
  </ol>
  
  <p>docker network connect test [container id 1]</p>
  
  <p>docker network connect test [container id 2]</p>
  
  <ol start="3">
  <li>If I inspect the network everything seems to be fine, but the api is still not callable on localhost</li>
  </ol>
  
  <p>Other potential useful stuff:</p>
  
  <p>docker-compose.yml :</p>
  
  <pre><code>version: "3.7"
  services:
    clearance:
       build:
       # network: host
        context: .
        dockerfile: DockerFileLocal
       ports:
         - 4200:4200
       volumes:
         - /app/node_modules
         - .:/app
  </code></pre>
  
  <p>proxy.conf.json</p>
  
  <pre><code>{
     "/api/*": {
        "target": "https://localhost:44384",
        "secure": false,
        "logLevel": "debug",
        "changeOrigin": true
     }
  }
  </code></pre>
  
  <p>What am I missing?</p>