Installing Postgres using Docker Compose

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
version: "3.9"

services:
postgres:
image: postgres:13.22-trixie
container_name: postgres_13
restart: always
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: mydb
ports:
- "5432:5432"
volumes:
- ./data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U root"]