Giter Club home page Giter Club logo

postgres-backup-restore-s3's Introduction

Docker Pulls

Postgres-Backup-Restore-S3

Backup and restore PostgresSQL from S3

This dockerfile started out as a fork of the awesome postgres-backup-s3, with a couple of changes:

  • Added restore ability
  • Made it possible to only download backup from s3
  • Made it possible to pin another postgres version in dockerfile
  • Added so backup sends a current.sql.gz along with the timestamped backup
  • Removed cron job (since I have no need for it)
  • Supports both postgres 9.4, 9.5, 9.6 and 10

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 marteinn/postgres-backup-restore-s3:9.5

Docker Compose:

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

pgbackups3:
    image: marteinn/postgres-backup-restore-s3:9.5
    links:
        - postgres
    environment:
        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
        DOWNLOAD_PATH: /shared

Restoring backup

  • Restore database from the latest backup docker-compose run db_backup sh run.sh restore

  • Restore database from a specific backup docker-compose run db_backup sh run.sh restore 2016-03-02T19:47:35Z

Download backup

  • Download database from a specific backup docker-compose run db_backup sh run.sh download

  • Download database from a specific backup docker-compose run db_backup sh run.sh download 2016-03-02t19:47:35z

Building for dockerhub

Make are used to simplify dockerhub distributions.

  • make build: Build images
  • make push: Push images to dockerhub

License

Postgres-Backup-Restore-S3 is released under the MIT License.

postgres-backup-restore-s3's People

Contributors

marteinn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

postgres-backup-restore-s3's Issues

Published docker image does not work?

Im getting

postgres-backup-restore-s3_1  | run.sh: source: line 58: backup.sh: not found
postgres-backup-restore-s3_1  | run.sh: source: line 58: backup.sh: not found

using marteinn/postgres-backup-restore-s3:latest

Add support for older postgres versions

Versions should follow the official docker images

9.1.20, 9.1 (9.1/Dockerfile)
9.2.15, 9.2 (9.2/Dockerfile)
9.3.11, 9.3 (9.3/Dockerfile)
9.4.6, 9.4 (9.4/Dockerfile)
9.5.1, 9.5, 9, latest (9.5/Dockerfile)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.