pg-s3-backup image backs up all databases in a PostgreSQL cluster to an Amazon S3 bucket. This image is used for daily automated database backups.
Purpose
This Docker image bundles the AWS CLI and PostgreSQL tools to provide automated database backup functionality. It connects to a PostgreSQL cluster, dumps all databases, and uploads them to a specified S3 bucket.Usage
To use this image, you need to configure the following environment variables:Required Environment Variables
| Variable | Description |
|---|---|
AWS_ACCESS_KEY_ID | AWS access key for S3 authentication |
AWS_SECRET_ACCESS_KEY | AWS secret key for S3 authentication |
AWS_DEFAULT_REGION | AWS region where the S3 bucket is located |
S3_BUCKET | Name of the S3 bucket to store backups |
DATABASE_URL | PostgreSQL connection URL |
Example
How It Works
- Connects to the PostgreSQL cluster using the provided
DATABASE_URL - Dumps all databases in the cluster
- Uploads the database dumps to the specified S3 bucket
- Can be scheduled to run daily for automated backups