version: "3"
services:
db:
image: postgres:13
ports:
- 5432:5432
environment:
- POSTGRES_DB=app
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
<project>/settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'HOST': 'localhost',
'NAME': 'app',
'USER': 'admin',
'PASSWORD': 'admin'
}
}
...