Sign inSign up

silintl/postgresql-backup-restore

Sponsored OSS

By SIL International

Updated 8 months ago
Archived

DEPRECATED. Move to Packages at github.com/sil-org/postgresql-backup-restore

Image
Databases & storage
1

10K+

silintl/postgresql-backup-restore repository overview

postgresql-backup-restore

Service to backup and/or restore a PostgreSQL database using S3

How to use it

  1. Create an S3 bucket to hold your backups
  2. Turn versioning on for that bucket
  3. Supply all appropriate environment variables
  4. Run a backup and check your bucket for that backup
Environment variables

MODE=[backup|restore]

DB_HOST= hostname of the database server

DB_NAME= name of the database

DB_OPTIONS=opt1 opt2 opt3 ... optional arguments to supply to the backup or restore commands

DB_ROOTPASSWORD= password for the DB_ROOTUSER

DB_ROOTUSER= database administrative user, typically "postgres" for PostgreSQL databases

DB_USERPASSWORD= password for the DB_USER

DB_USER= user that accesses the database (PostgreSQL "role")

AWS_ACCESS_KEY= used for S3 interactions

AWS_SECRET_KEY= used for S3 interactions

S3_BUCKET= e.g., s3://database-backups NOTE: no trailing slash

It's recommended that your S3 bucket have versioning turned on.

Docker Hub

This image is built automatically on Docker Hub as silintl/postgresql-backup-restore

Playing with it locally

You'll need Docker, Docker Compose, and Make.

  1. cp local.env.dist local.env and supply variables
  2. Ensure you have a gz dump in your S3 bucket to be used for testing. A test database is provided as part of this project in the test folder. You can copy it to S3 as follows:
  • aws s3 cp test/world.sql.gz ${S3_BUCKET}/world.sql.gz
  1. make

A UI into the local database will then be running at http://localhost:8080

Tag summary

Content type

Image

Digest

sha256:b656200a2

Size

94 MB

Last updated

8 months ago

docker pull silintl/postgresql-backup-restore

This week's pulls

Pulls:

67

Last week