Backup PostgresSQL versions to S3 (supports periodic backups). Supports multiple postgres versions.
7.6K
Backup PostgresSQL to S3 (supports periodic backups)
This image supports multiple PostgreSQL versions through automated builds via Drone CI.
The following PostgreSQL versions are automatically built and tagged:
boro/postgres-backup-s3:14)boro/postgres-backup-s3:15)boro/postgres-backup-s3:16)boro/postgres-backup-s3:17)If you need to build a specific version manually, you can use the POSTGRES_VERSION build argument:
# Build for PostgreSQL 15
$ docker build --build-arg POSTGRES_VERSION=15 -t boro/postgres-backup-s3:15 .
The repository includes a .drone.yml configuration that automatically builds all supported PostgreSQL versions on push/tag events. Each version gets tagged with:
14, 15, 16, 17)Docker:
$ docker run \
-e S3_ACCESS_KEY_ID=key \
-e S3_SECRET_ACCESS_KEY=secret \
-e S3_BUCKET=my-bucket \
-e S3_PREFIX=backup \
-e POSTGRES_DATABASE=dbname \
-e POSTGRES_USER=user \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_HOST=localhost \
boro/postgres-backup-s3:15
Docker Compose:
postgres:
image: postgres:15
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
pgbackups3:
image: boro/postgres-backup-s3:15
links:
- postgres
environment:
SCHEDULE: "@daily"
S3_ENDPOINT: region
S3_ACCESS_KEY_ID: key
S3_SECRET_ACCESS_KEY: secret
S3_BUCKET: my-bucket
S3_PREFIX: daily/backup
POSTGRES_DATABASE: dbname
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_EXTRA_OPTS: "--schema=public --blobs"
POSTGRES_DATABASE is not setIt will attempt to use the login credentials to find & backup all databases into a single .sql.gz file.
If MULTI_FILES is set to yes, it'll create a separate gzip backup for each database + a gzip for postgres globals.
You can additionally set the SCHEDULE environment variable like -e SCHEDULE="@daily" to run the backup automatically.
More information about the scheduling can be found here.
The following environment variables can be set to configure the behavior of the postgres-backup-s3 container:
us-west-1.backup.None.5432.pg_dump or pg_dumpall command.yes, each database will be backed up into a separate file, along with a separate file for PostgreSQL globals.These environment variables allow you to customize the backup process to suit your needs, including specifying which databases to back up, where to store the backups, and how often to perform the backups automatically.
Content type
Image
Digest
sha256:11655d1f9…
Size
46.3 MB
Last updated
about 1 year ago
docker pull boro/postgres-backup-s3:17