Password authenticated failed + Docker + Django

Not my first time using Docker but obviously I am doing something wrong with my setup that I can’t figure out.

Here’s my docker-compose.yml

version: "3.1"
services:
   db:
     image: postgres:9.6.9-alpine
     environment:
         POSTGRES_USER: rentalapp
         POSTGRES_PASSWORD: rentalapp
         POSTGRES_DB: rentalapp
     ports:
        - "5432:5432"
     volumes:
        - pgdata:/var/lib/postgresql/data
volumes:
  pgdata:

And here’s my local.py

DATABASES = {
    "default": {
       "ENGINE": "django.db.backends.postgresql",
       "USER": "rentalapp",
       "PASSWORD": "rentalapp",
       "PORT": 5432,
       "NAME": "rentalapp",
       "HOST": "localhost",
       "ATOMIC_REQUESTS": True,
 }
}

Traceback:

django.db.utils.OperationalError: FATAL:  password authentication failed for user "rentalapp"

Source: StackOverflow