Skip to content

kyrylich/docker-postgres-backup

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker PostgreSQL Backup

Docker image that dumps a Postgres database, and uploads it to an Amazon S3 bucket.

Required environment variables

  • DB_HOST: Postgres hostname
  • DB_PORT: Postgres port
  • DB_PASS: Postgres password
  • DB_USER: Postgres username
  • DB_NAME: Name of database
  • AWS_S3_PATH: Amazon S3 path in the format: s3://bucket-name/some/path
  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_DEFAULT_REGION

Optional environment variables

  • KEEP_BACKUP_DAYS: The number of days to keep backups for when pruning old backups

Restoring a backup

This image can also be run as a one off task to restore one of the backups. To do this, we run the container with the command: /backup/restore.sh [S3-filename].

The following environment variables are required:

  • DB_HOST: Postgres hostname
  • DB_PASS: Postgres password
  • DB_USER: Postgres username
  • DB_NAME: Name of database
  • AWS_S3_PATH: Amazon S3 path in the format: s3://bucket-name/some/path
  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_DEFAULT_REGION

About

Docker image that dumps a Postgres database, and uploads it to an Amazon S3 bucket

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 88.0%
  • Dockerfile 9.4%
  • Shell 2.6%