https://github.com/katharostech/docker_postgres-backup
Simple Docker image for backing up a PostgreSQL database.
https://github.com/katharostech/docker_postgres-backup
Last synced: 5 months ago
JSON representation
Simple Docker image for backing up a PostgreSQL database.
- Host: GitHub
- URL: https://github.com/katharostech/docker_postgres-backup
- Owner: katharostech
- License: unlicense
- Created: 2019-07-10T16:41:01.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-10T17:41:22.000Z (almost 7 years ago)
- Last Synced: 2025-10-10T18:22:49.443Z (8 months ago)
- Language: Dockerfile
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Docker Postgres Backup
[](https://cloud.drone.io/katharostech/docker_postgres-backup)
Extreemly simple Postgres backup container that simply dumps a Postgresql DB to a file on a cron schedule.
## Usage
```
docker run -v backup-volume:/backup katharostech/postgres-backup
```
The backup will be written to `/backup/db-backup.sql.gz`. Backups will be run on the `CRON_SCHEDULE` and will replace the previously taken backup at each run.
## Environment Variables
### `CRON_SCHEDULE`
**Default:** `0 0 * * *`
### `INIT_BACKUP`
Set to `true` to do a backup when the container is started.
**Default:** `false`
### `PG_HOST`
**Default:** postgres
### `PG_PORT`
**Default:** `5432`
### `PG_USER`
**Default:** `postgres`
### `PG_PASSWORD`
**Default:** `password`
### `PG_DB`
**Default:** `postgres`
### `FAILURE_HOOK`
This allows you to insert a command will be run when a backup fails. You can use this to trigger a `curl` on a webhook to your chat software or something similar.
**Default:** `true`