Docker Repository - bfren ecosystem
PostgreSQL comes pre-installed (12, 13, 14, 15 or 16) with automatic backups built-in.
Backups for every database are stored:
- in the /backupvolume
- in subfolders by date and time (yyMMddhhmm)
- every eight hours
See For Backups for configuration variables.
- 5432
| Volume | Purpose | 
|---|---|
| /backup | Backup files (also used for export / import scripts - see helper functions). | 
| /data | Data files. | 
| Variable | Values | Description | Default | 
|---|---|---|---|
| BF_PG_BACKUP_COMPRESS_FILES | 0 or 1 | Whether or not to compress backup files (using bzip). | 0 | 
| BF_PG_BACKUP_KEEP_FOR | Nu duration | The length of time to keep backups. | 28day | 
| Variable | Values | Description | Default | 
|---|---|---|---|
| BF_PG_APPLICATION | string | Application name - will be used as BF_PG_DATABASE,BF_PG_PASSWORDandBF_PG_USERNAMEif they are not set. | None | 
| BF_PG_DATABASE | string | Database name(s) - multiple databases can be separated by a comma. | None | 
| BF_PG_PASSWORD | string | Application password - required if BF_PG_APPLICATIONis not | None | 
| BF_PG_USERNAME | string | Application username - required if BF_PG_APPLICATIONis not used. | None | 
| Function | Arguments | Purpose | Usage | 
|---|---|---|---|
| pg-dump | None | Run backup manually. | docker exec <<CONTAINER>> pg-dump | 
| pg-export | 1: Database name | Dumps the specified database as a SQL file to the root of the /backupvolume. | docker exec <<CONTAINER>> pg-export <<DB_NAME>> | 
| pg-import | 1: Database name | Executes all files in the root of the /backupvolume. | docker exec <<CONTAINER>> pg-import <<DB_NAME>> | 
| pg-restore | 1: Backup set | Deletes all files in /datavolume, then restores from the specified backup dump. | docker exec <<CONTAINER>> pg-restore 202107180500 | 
Copyright (c) 2021-2025 bfren (unless otherwise stated)