Docker image of PostgreSQL database with regular backups into AWS S3
1.3K
This image is based on official Postgres image so you can use everything mentioned there. The image regularly backups the database and uploads the backup into AWS S3 using infrequent storage class. The database is backed up every hour.
How to setup AWS S3 Bucket
When starting the database with backup feature on you have to provide credentials for the upload through docker environment variables.
Run command will looks like
docker run -d --name db -p 5432:5432 -e AWS_KEY=access_key -e AWS_SECRET=secret_key -e S3BUCKET=s3://com-yourcompany/dbbackup/ -e POSTGRES_USER=myapp -e POSTGRES_PASSWORD=my-password tonda100/postgres-s3
If the AWS_KEY, AWS_SECRET or S3BUCKET will not be set. The image will works like ordinary postgres docker image.
The database backup are are triggered by cron at:
The image uses the Europe/Prague timezone as default one. The timezone could be change using environment variable TZ e.g. -e TZ=America/Toronto
Project is available on GitHub
Content type
Image
Digest
Size
120.6 MB
Last updated
over 9 years ago
docker pull tonda100/postgres-s3