-
-
Save zinderud/15b533ac391d71e1d8d78f77fec72ec6 to your computer and use it in GitHub Desktop.
inceleme listesi | |
https://github.com/camptocamp/bivac | |
docker run -d --name bivac -v /var/run/docker.sock:/var/run/docker.sock:ro \ | |
-e AWS_ACCESS_KEY_ID=XXXX \ | |
-e AWS_SECRET_ACCESS_KEY=XXXXXX \ | |
-e BIVAC_TARGET_URL=s3:my-bucket \ | |
-e RESTIC_PASSWORD=foo \ | |
-e BIVAC_SERVER_PSK=toto \ | |
-e BIVAC_AGENT_IMAGE=camptocamp/bivac:stable \ | |
-p 8182:8182 \ | |
camptocamp/bivac:stable manager | |
You can easily deploy Bivac with a simple docker-compose.yml: | |
version: '2' | |
services: | |
bivac: | |
image: camptocamp/bivac:stable | |
command: manager | |
ports: | |
- "8182:8182" | |
volumes: | |
- "/var/run/docker.sock:/var/run/docker.sock:ro" | |
environment: | |
AWS_ACCESS_KEY_ID: XXXX | |
AWS_SECRET_ACCESS_KEY: XXXXXX | |
RESTIC_PASSWORD: foo | |
BIVAC_TARGET_URL: s3:my-bucket | |
BIVAC_SERVER_PSK: toto | |
BIVAC_AGENT_IMAGE: camptocamp/bivac:stable | |
Backup:
docker exec -t -u postgres your-db-container pg_dumpall -c > dump_date +%d-%m-%Y"_"%H_%M_%S.sql
Restore:
cat your_dump.sql | docker exec -i your-db-container psql -Upostgres
docker uzerindeki psql volumleri belirli zaman aralıklarında yedekleme işlemi
Deleting all the volumes
Once all the containers are deleted, you can delete all the Docker volumes on your computer using the following command
docker volume prune
If you don't want to delete all the Docker volumes on your computer, you can search for a specific one and deleting it
docker volume ls
docker volume rm <name_of_volume>
https://blog.koley.in/2019/backup-and-restore-postgresql-database-running-on-docker
To backup, we use the pg_dump tool:
docker exec <postgres_container_name> pg_dump -U postgres <database_name> > backup.sql
This would create a text file named backup.sql containing all the data and schema of your database. You can then import this data back into postgres using the psql tool:
docker exec -i <postgres_container_name> psql -U postgres -d <database_name> < backup.sql
The -i flag is of particular importance here because the psql tool needs to be run interactively for it to be able to read from the backup.sql file.
Note: The above commands assume that you have postgres as the default user for the database. This is indeed the case for the standard postgres docker image.
https://simkimsia.com/how-to-restore-database-dumps-for-postgres-in-docker-container/