summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDessalines <happydooby@gmail.com>2019-08-12 22:02:03 -0700
committerDessalines <happydooby@gmail.com>2019-08-12 22:02:03 -0700
commitc148eefc1df3eda124246691f62cc7ecfe2d3558 (patch)
tree5d05a3c950c781971254d33bf7e321a0e85711ab
parentc2cb36bfa4bd8e55fbdbde51bd9fbfd2554ccfa4 (diff)
Persist docker postgres data in a volume
- Fixes #197
-rw-r--r--docker-compose.yml6
-rw-r--r--docker/docker-compose.yml6
2 files changed, 10 insertions, 2 deletions
diff --git a/docker-compose.yml b/docker-compose.yml
index 2b9f3171..8607d546 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -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:
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index 4f5d51a9..aafcae1a 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -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: