title: Backend container can't connect to database - Sequelize, Node, Postgres, Docker
body: <p>When I try to connect my backend (using Sequelize) I get this following error:</p>
  
  <pre><code>error ConnectionRefusedError [SequelizeConnectionRefusedError]: connect ECONNREFUSED 127.0.0.1:5432
  </code></pre>
  
  <p><strong>docker-compose.yml</strong>:</p>
  
  <pre><code>version: "3.7"
  services:
    frontend:
      build:
        context: ./client
        dockerfile: Dockerfile
      image: client
      ports:
        - "3000:3000"
      volumes:
        - ./client:/usr/src/app
    backend:
      build:
        context: ./server
        dockerfile: Dockerfile
      image: server
      ports:
        - "8000:8000"
      volumes:
        - ./server:/usr/src/app
    db:
      image: postgres
      environment:
        POSTGRES_DB: ckl
        POSTGRES_USER: postgres
        POSTGRES_PASSWORD: docker
      ports:
        - "5432:5432"
  </code></pre>
  
  <p>What am I doing wrong ? </p>
  
  <p>Thanks in advance</p>