Sign inSign up

awlpublic/postgres-backup

By awlpublic

Updated almost 3 years ago

Image
0

1.4K

awlpublic/postgres-backup repository overview

postgres-backup-s3

Backup PostgresSQL to S3 and Local path (supports periodic backups)

Usage

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 awlpublic/postgres-backup

Docker Compose:

postgres:
  image: postgres
  environment:
    POSTGRES_USER: user
    POSTGRES_PASSWORD: password

pgbackups3:
  image: awlpublic/postgres-backup
  links:
    - postgres
  environment:
    SCHEDULE: '@daily'
    S3_REGION: region
    S3_ACCESS_KEY_ID: key
    S3_SECRET_ACCESS_KEY: secret
    S3_BUCKET: my-bucket
    S3_PREFIX: backup
    POSTGRES_DATABASE: dbname
    POSTGRES_USER: user
    POSTGRES_PASSWORD: password
    POSTGRES_EXTRA_OPTS: '--schema=public --blobs'
    ENABLE_BACKUP_TO_S3: 'yes'
    ENABLE_BACKUP_TO_LOCAL: 'no'
    PUSH_URL: ''
Automatic Periodic Backups

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.

Push URL (>= Version 1.4.2)

You can push a check URL (for example StatusCake) to handle alerting.

Tag summary

Content type

Image

Digest

sha256:d0a4247c6

Size

122.4 MB

Last updated

almost 3 years ago

docker pull awlpublic/postgres-backup