Answer the question
In order to leave comments, you need to log in
How to restore postgres data?
volumes:
- /var/lib/docker/old/95390d0fa0cb02a9baf131967acc27a65a23b073ab0201c4935de53d6f87ae2e/_data/:/var/lib/postgresql/data/
Answer the question
In order to leave comments, you need to log in
Move the files somewhere where it will be convenient to store them.
Make a bind-mount of the directory where you moved the files.
Let's say the files are placed in a directory called data and it is placed in the same place as the docker-compoe.yml file , then:
version: '3.1'
services:
db:
image: postgres:13.4
container_name: postgres13
restart: always
environment:
POSTGRES_PASSWORD: strong_password
volumes:
- ./data:/var/lib/postgresql/data
ports:
- '5432:5432'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question