services:
db:
- image: postgres
+ image: postgres:12-alpine
restart: always
environment:
POSTGRES_USER: rrr
POSTGRES_PASSWORD: rrr
POSTGRES_DB: rrr
+ volumes:
+ - db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U rrr"]
interval: 5s
depends_on:
db:
condition: service_healthy
+volumes:
+ db:
services:
db:
- image: postgres
+ image: postgres:12-alpine
restart: always
environment:
POSTGRES_USER: rrr
POSTGRES_PASSWORD: rrr
POSTGRES_DB: rrr
+ volumes:
+ - db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U rrr"]
interval: 5s
depends_on:
db:
condition: service_healthy
+volumes:
+ db: