From: Dessalines Date: Tue, 13 Aug 2019 05:02:03 +0000 (-0700) Subject: Persist docker postgres data in a volume X-Git-Url: http://these/git/%7B%60https:/%7B%60css/themes/%22https:/nerdica.net/%7BdocsUrl%7D?a=commitdiff_plain;h=ad4dbbcd7726e75aea1e06111a1af3039cbeca70;p=lemmy.git Persist docker postgres data in a volume - Fixes #197 --- 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: