title: Docker containers requests return Error: read ECONNRESET
body: <p>I am using docker-compose to start two containers: one with a micronaut service and one with postgres.</p>
  <p>This is my docker-compose.yml</p>
  <pre><code>version: &quot;3.8&quot;
  
  services:
    web:
      image: &quot;time&quot;
      container_name: &quot;time&quot;
      build:
        context: .
        network: bridge
      ports:
        - &quot;8081:8080&quot;
      depends_on:
        - db
      links:
        - &quot;db&quot;
      environment:
        - PGHOST=db
        - PGDATABASE=postgres
        - PGUSER=postgres
  
    db:
      image: &quot;postgres&quot;
      ports:
        - &quot;5432:5432&quot;
      environment:
        POSTGRES_USER: postgres
        POSTGRES_PASSWORD: postgres
        POSTGRES_DB: time
  </code></pre>
  <p>But when I try to send a request to one of my endpoints, nothing happens until eventually I get a Error: read ECONNRESET</p>
  <p>Of course when I run my app in my PC outside of docker, I can send requests fine. Is there anything wrong with my set up?</p>
  <p>This other set up works fine, but I'd like to know how to get the two containers to connect like in my first docker-compose AND being able to access them from my host.</p>
  <pre><code>version: &quot;3.8&quot;
  
  services:
    web:
      image: &quot;time&quot;
      container_name: &quot;time&quot;
      build: .
      depends_on:
        - db
      environment:
        - PGHOST=db
        - PGDATABASE=postgres
        - PGUSER=postgres
      network_mode: host
  
    db:
      image: &quot;postgres&quot;
      environment:
        POSTGRES_USER: postgres
        POSTGRES_PASSWORD: postgres
        POSTGRES_DB: time
      network_mode: host
  </code></pre>