I am trying to bind django app with postgresql database.
version: "3.9"
services:
db:
image: postgis/postgis:13-3.1
restart: always
expose:
- "5432"
ports:
- "5432:5432"
volumes:
- postgresql-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_DB: mydb
POSTGRES_PASSWORD: postgres
POSTGRES_HOST: localhost
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
volumes:
postgresql-data: