Persist docker postgres data in a volume

- Fixes #197
This commit is contained in:
Dessalines 2019-08-12 22:02:03 -07:00
parent d8361f2e00
commit a17fbc6e61
2 changed files with 10 additions and 2 deletions

View file

@ -2,12 +2,14 @@ version: '2.4'
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
@ -27,3 +29,5 @@ services:
depends_on:
db:
condition: service_healthy
volumes:
db:

View file

@ -2,12 +2,14 @@ version: '2.4'
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
@ -26,3 +28,5 @@ services:
depends_on:
db:
condition: service_healthy
volumes:
db: