I am struggeling to get this working. It is no problem for me to set up a Postgres Database with Docker and acess it from other clients with Dbeaver or PGAdmin. My problem is, I am not able to perform an automatic backup of the docker container or volume.
This is my Docker Compose file:
version: '3.8'
services:
db:
container_name: imatecTest
image: postgres
restart: always
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: test
ports:
- "5432:5432"
pgadmin:
container_name: pgadmin4
image: dpage/pgadmin4
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: root
ports:
- "5050:80
The only way it "worked" was this: I saved the volume of the docker container locally in my windows directory and did my backup with windows-backup. The problem is I have to shut down my database during the backup otherwise there will be data loss.
Can you give me some advice how to perform an automatic backup of my volume or the whole container with PG_Dump or something else?