title: Node not talking with Postgres Database after using Docker
body: <p>Im very new to Docker. I'm trying to dockerize a very simple to do app build with react, node/express and postgret. I've been reading a bunch of articles and looking at solutions here in stackoverflow and still cannot figure out why my app is not working. When I run docker-compose up -d, it builds a cluster with three containers. Perfect so far good, however when i check the app and try to add a new todo i see a message in the server container <code>connect ECONNREFUSED 127.0.0.1:5432</code>. I'm not sure What I need to do to have the app running like it should. I really appreciate any help.</p>
  <p>this is my docker-compose.yml file:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>version: '3'
  services:
      postgres:
          image: postgres:12.1
          ports:
              - "5432:5432"
          environment:
              POSTGRES_PASSWORD: Elchido10
              POSTGRES_USER: juancastillo
              POSTGRES_DB: perntodo
          volumes:
              - ./postgresql/data:/var/lib/postgresql/data
          networks: 
              - todo-app
      server:
          image: todo_server
          environment: 
              DB_HOST: host.doceker.internal
              DB_USER: juancastillo
              DB_PASS: Elchido10
              DATABASE_URL: postgres://username:pgpassword@db:5432/perntodo
          
          build:
              context: ./server
              dockerfile: Dockerfile
          volumes:
              - /app/node_modules
              - ./server/config:/app/config
              - ./server/src:/app/src
              - ./server/test:/app/test
          ports:
              - "5000:5000"
          depends_on: 
              - postgres
          networks: 
              - todo-app
      client:
          image: todo_client
          stdin_open: true
          build:
              context: ./client
              dockerfile: Dockerfile
          volumes:
              - /app/node_modules
              - ./client:/app
          ports:
              - "3000:3000"
          networks: 
              - todo-app
          
  networks: 
      todo-app:
          driver: bridge</code></pre>
  </div>
  </div>
  </p>
  <p>this is how i am connecting to the database:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const Pool = require('pg').Pool;
  
  const pool = new Pool({
    user: "juancastillo",
    password: "Elchido10",
    host: "postgresdb",
    post: 5432,
    database: "perntodo"
  })
  
  module.exports = pool;</code></pre>
  </div>
  </div>
  </p>