]> Untitled Git - lemmy.git/commitdiff
Persist docker postgres data in a volume
authorDessalines <tyhou13@gmx.com>
Tue, 13 Aug 2019 05:02:03 +0000 (22:02 -0700)
committerDessalines <tyhou13@gmx.com>
Tue, 13 Aug 2019 05:02:03 +0000 (22:02 -0700)
- Fixes #197

docker-compose.yml
docker/docker-compose.yml

index 2b9f317181bf67c307634be79545d190015d7310..8607d546c0d47df13227d111e54533f91315ee6d 100644 (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:
index 4f5d51a92aa4a425337dde02efa70f4612e803f9..aafcae1a7c0de929c65f82cdd375b10b7d0c860d 100644 (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: