Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Full Stack Fastapi Postgresql | 11,206 | 22 days ago | 208 | mit | Python | |||||
Full stack, modern web application generator. Using FastAPI, PostgreSQL as database, Docker, automatic HTTPS and more. | ||||||||||
Docker Gitlab | 7,538 | 3 days ago | 521 | mit | Shell | |||||
Dockerized GitLab | ||||||||||
Coolify | 7,209 | 3 days ago | 230 | apache-2.0 | Svelte | |||||
An open-source & self-hostable Heroku / Netlify alternative. | ||||||||||
Pgloader | 4,413 | 5 days ago | 1 | February 27, 2018 | 288 | other | Common Lisp | |||
Migrate to PostgreSQL in a single command! | ||||||||||
Devilbox | 4,080 | 4 days ago | 42 | mit | PHP | |||||
A modern Docker LAMP stack and MEAN stack for local development | ||||||||||
Stolon | 4,066 | a month ago | 17 | September 03, 2021 | 141 | apache-2.0 | Go | |||
PostgreSQL cloud native High Availability and more. | ||||||||||
Dbmate | 3,166 | 1 | 2 days ago | 27 | March 25, 2022 | 12 | mit | Go | ||
:rocket: A lightweight, framework-agnostic database migration tool. | ||||||||||
Graphjin | 2,630 | 2 | 2 days ago | 457 | September 20, 2022 | 15 | apache-2.0 | Go | ||
GraphJin - Build NodeJS / GO APIs in 5 minutes not weeks | ||||||||||
Changelog.com | 2,522 | 3 days ago | 10 | other | Elixir | |||||
Changelog is news and podcast for developers. This is our open source platform. | ||||||||||
Postgresqltuner | 2,410 | a day ago | 10 | gpl-3.0 | Perl | |||||
Simple script to analyse your PostgreSQL database configuration, and give tuning advice |
A simple docker container that runs PostgreSQL / PostGIS backups (PostGIS is not required it will backup any PG database). It is primarily intended to be used with our docker postgis docker image. By default, it will create a backup once per night (at 23h00)in a nicely ordered directory by a year / month.
There are various ways to get the image onto your system:
The preferred way (but using most bandwidth for the initial image) is to get our docker trusted build like this:
docker pull kartoza/pg-backup:$POSTGRES_MAJOR_VERSION-$POSTGIS_MAJOR_VERSION.${POSTGIS_MINOR_RELEASE}
Where the environment variables are
POSTGRES_MAJOR_VERSION=13
POSTGIS_MAJOR_VERSION=3
POSTGIS_MINOR_RELEASE=1
We highly suggest that you use a tagged image that match the PostgreSQL image you are running i.e (kartoza/pg-backup:13-3.1 for backing up kartoza/postgis:13-3.1 DB). The latest tag may change and may not successfully back up your database.
To build the image yourself do:
git clone https://github.com/kartoza/docker-pg-backup.git
cd docker-pg-backup
./build.sh # It will build the latest version corresponding the latest PostgreSQL version
To create a running container do:
POSTGRES_MAJOR_VERSION=13
POSTGIS_MAJOR_VERSION=3
POSTGIS_MINOR_RELEASE=1
docker run --name "db" -p 25432:5432 -d -t kartoza/postgis:$POSTGRES_MAJOR_VERSION-$POSTGIS_MAJOR_VERSION.${POSTGIS_MINOR_RELEASE}
docker run --name="backups" --link db:db -v `pwd`/backups:/backups -d kartoza/pg-backup:$POSTGRES_MAJOR_VERSION-$POSTGIS_MAJOR_VERSION.${POSTGIS_MINOR_RELEASE}
You can also use the following environment variables to pass a username and password etc for the database connection.
POSTGRES_USER
if not set, defaults to : dockerPOSTGRES_PASS
if not set, defaults to : dockerPOSTGRES_PORT
if not set, defaults to : 5432POSTGRES_HOST
if not set, defaults to : dbARCHIVE_FILENAME
you can use your specified filename format here, default to empty, which means it will use default filename format.DBLIST
a space-separated list of databases for backup, e.g. gis data
. Default is all databases.REMOVE_BEFORE
remove all old backups older than specified amount of days, e.g. 30
would only keep backup files younger than 30 days. Default: no files are ever removed.DUMP_ARGS
The default dump arguments based on official
PostgreSQL Dump options.RESTORE_ARGS
Additional restore commands based on official PostgreSQL restore
STORAGE_BACKEND
The default backend is to store the backup files. It can either
be FILE
or S3
(Example minio or amazon bucket) backends.DB_TABLES
A boolean variable to specify if the user wants to dump the DB as individual tables.
Defaults to No
CRON_SCHEDULE
specifies the cron schedule when the backup needs to run. Defaults to midnight daily.Note To avoid interpolation issues with the env variable ${CRON_SCHEDULE}
you will
need to provide the variable as a quoted string i.e ${CRON_SCHEDULE}='*/1 * * * '
or ${CRON_SCHEDULE}="/1 * * * *"
Here is a more typical example using docker-composer:
The default backup archive generated will be stored in the /backups
directory (inside the container):
/backups/$(date +%Y)/$(date +%B)/${DUMPPREFIX}_${DB}.$(date +%d-%B-%Y).dmp
As a concrete example, with DUMPPREFIX=PG
and if your postgis has DB name gis
.
The backup archive would be something like:
/backups/2019/February/PG_gis.13-February-2019.dmp
If you specify ARCHIVE_FILENAME
instead (default value is empty). The
filename will be fixed according to this prefix.
Let's assume ARCHIVE_FILENAME=latest
The backup archive would be something like
/backups/latest.gis.dmp
The script uses s3cmd for backing up files to S3 bucket.
ACCESS_KEY_ID
Access key for the bucketSECRET_ACCESS_KEY
Secret Access key for the bucketDEFAULT_REGION
Defaults to 'us-west-2'HOST_BASE
HOST_BUCKET
SSL_SECURE
The determines if the S3 bucket isBUCKET
Indicates the bucket name that will be created.You can read more about configuration options for s3cmd
For a typical usage of this look at the docker-compose-s3.yml
The image supports mounting the following configs:
S3
backendAn environment variable ${EXTRA_CONFIG_DIR}
controls the location of the folder.
If you need to mount s3cfg file. You can run the following:
-e ${EXTRA_CONFIG_DIR}=/settings
-v /data:/settings
Where s3cfg
is located in /data
The image provides a simple restore script. You need to specify some environment variables first:
TARGET_DB
The db name to restoreWITH_POSTGIS
Kartoza specific, to generate POSTGIS extension along with the restore processTARGET_ARCHIVE
The full path of the archive to restoreNote: The restore script will try to delete the TARGET_DB
if it matches an existing database,
so make sure you know what you are doing.
Then it will create a new one and restore the content from TARGET_ARCHIVE
It is generally a good practice to restore into an empty new database and then manually drop and rename the databases.
i.e if your original database is named gis
, you can restore it into a new database called gis_restore
If you specify these environment variables using docker-compose.yml file, then you can execute a restore process like this:
docker-compose exec dbbackups /backup-scripts/restore.sh
Tim Sutton ([email protected])
Admire Nyakudya ([email protected])
Rizky Maulana ([email protected]) July 2021