This build a very simple container that backs up psql databases to S3.
This containers expects the following environment variables:
DATABASE_NAME
name of the database that should be used for identifying the backupDATABASE_URL
url how to connect to the databaseBACKUP_BUCKET
name of the S3 bucket were the database backup should be sent toAWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
To restore the backup completely overwriting the current database use:
pg_restore -O -c --if-exists -x -d "${DATABASE_URL}" < backup-file.dump