diff --git a/compose/.apps/pgadmin/pgadmin.aarch64.yml b/compose/.apps/pgadmin/pgadmin.aarch64.yml old mode 100755 new mode 100644 diff --git a/compose/.apps/pgadmin/pgadmin.hostname.yml b/compose/.apps/pgadmin/pgadmin.hostname.yml old mode 100755 new mode 100644 diff --git a/compose/.apps/pgadmin/pgadmin.labels.yml b/compose/.apps/pgadmin/pgadmin.labels.yml old mode 100755 new mode 100644 diff --git a/compose/.apps/pgadmin/pgadmin.netmode.yml b/compose/.apps/pgadmin/pgadmin.netmode.yml old mode 100755 new mode 100644 diff --git a/compose/.apps/pgadmin/pgadmin.ports.yml b/compose/.apps/pgadmin/pgadmin.ports.yml old mode 100755 new mode 100644 diff --git a/compose/.apps/pgadmin/pgadmin.x86_64.yml b/compose/.apps/pgadmin/pgadmin.x86_64.yml old mode 100755 new mode 100644 diff --git a/compose/.apps/pgadmin/pgadmin.yml b/compose/.apps/pgadmin/pgadmin.yml old mode 100755 new mode 100644 diff --git a/compose/.apps/pgbackup/pgbackup.aarch64.yml b/compose/.apps/pgbackup/pgbackup.aarch64.yml old mode 100755 new mode 100644 diff --git a/compose/.apps/pgbackup/pgbackup.hostname.yml b/compose/.apps/pgbackup/pgbackup.hostname.yml old mode 100755 new mode 100644 diff --git a/compose/.apps/pgbackup/pgbackup.labels.yml b/compose/.apps/pgbackup/pgbackup.labels.yml old mode 100755 new mode 100644 diff --git a/compose/.apps/pgbackup/pgbackup.netmode.yml b/compose/.apps/pgbackup/pgbackup.netmode.yml old mode 100755 new mode 100644 diff --git a/compose/.apps/pgbackup/pgbackup.x86_64.yml b/compose/.apps/pgbackup/pgbackup.x86_64.yml old mode 100755 new mode 100644 diff --git a/compose/.apps/pgbackup/pgbackup.yml b/compose/.apps/pgbackup/pgbackup.yml old mode 100755 new mode 100644 diff --git a/docs/apps/pgadmin.md b/docs/apps/pgadmin.md index 7ac372bfbc..2c0d81adfa 100644 --- a/docs/apps/pgadmin.md +++ b/docs/apps/pgadmin.md @@ -1,17 +1,17 @@ -# pgAdmin - -[![Docker Pulls](https://img.shields.io/docker/pulls/dpage/pgadmin4?style=flat-square&color=607D8B&label=docker%20pulls&logo=docker)](https://hub.docker.com/r/dpage/pgadmin4) -[![GitHub Stars](https://img.shields.io/github/stars/pgadmin-org/pgadmin4?style=flat-square&color=607D8B&label=github%20stars&logo=github)](https://github.com/pgadmin-org/pgadmin4) -[![Compose Templates](https://img.shields.io/static/v1?style=flat-square&color=607D8B&label=compose&message=templates)](https://github.com/GhostWriters/DockSTARTer/tree/master/compose/.apps/pgadmin) - -## Description - -[pgAdmin](https://www.pgadmin.org/): pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world. - -## Install/Setup - -An email address (login) and password are the only required inputs for a fullly functional instance of pgAdmin. - -Full variable documentation is available in the pgadmin [documentation](https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html#environment-variables). - -Any variable name from [config.py](https://www.pgadmin.org/docs/pgadmin4/latest/config_py.html#config-py) can be defined in the format of `PGADMIN_CONFIG_*` in docker-compose.override.yml +# pgAdmin + +[![Docker Pulls](https://img.shields.io/docker/pulls/dpage/pgadmin4?style=flat-square&color=607D8B&label=docker%20pulls&logo=docker)](https://hub.docker.com/r/dpage/pgadmin4) +[![GitHub Stars](https://img.shields.io/github/stars/pgadmin-org/pgadmin4?style=flat-square&color=607D8B&label=github%20stars&logo=github)](https://github.com/pgadmin-org/pgadmin4) +[![Compose Templates](https://img.shields.io/static/v1?style=flat-square&color=607D8B&label=compose&message=templates)](https://github.com/GhostWriters/DockSTARTer/tree/master/compose/.apps/pgadmin) + +## Description + +[pgAdmin](https://www.pgadmin.org/): pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world. + +## Install/Setup + +An email address (login) and password are the only required inputs for a fullly functional instance of pgAdmin. + +Full variable documentation is available in the pgadmin [documentation](https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html#environment-variables). + +Any variable name from [config.py](https://www.pgadmin.org/docs/pgadmin4/latest/config_py.html#config-py) can be defined in the format of `PGADMIN_CONFIG_*` in docker-compose.override.yml diff --git a/docs/apps/pgbackup.md b/docs/apps/pgbackup.md index dde889c461..174eecd855 100644 --- a/docs/apps/pgbackup.md +++ b/docs/apps/pgbackup.md @@ -1,41 +1,41 @@ -# pgBackup - -[![Docker Pulls](https://img.shields.io/docker/pulls/prodrigestivill/postgres-backup-local?style=flat-square&color=607D8B&label=docker%20pulls&logo=docker)](https://hub.docker.com/r/prodrigestivill/postgres-backup-local) -[![GitHub Stars](https://img.shields.io/github/stars/prodrigestivill/docker-postgres-backup-local?style=flat-square&color=607D8B&label=github%20stars&logo=github)](https://github.com/prodrigestivill/docker-postgres-backup-local) -[![Compose Templates](https://img.shields.io/static/v1?style=flat-square&color=607D8B&label=compose&message=templates)](https://github.com/GhostWriters/DockSTARTer/tree/master/compose/.apps/pgbackup) - -## Description - -[pgBackup](https://hub.docker.com/r/prodrigestivill/postgres-backup-local): Backup PostgresSQL to the local filesystem with periodic rotating backups - -## Install/Setup - -Set your postgres host, username and password in the .env file along with a comma seperated list of databases you want to backup. - -By default, backups run daily. Change PGBACKUP_SCHEDULE to any valid [cron schedule](http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules) to modify the default. - -### Recommended docker-compose overrides - -For extra security, it is recommended to limit permissions on the backup folder to a priviledged user. Modify docker-compose.override.yml as below. - -If you are using postgres docker container, add a dependency to the container - -```yaml - pgbackup: - user: postgres:postgres - depends_on: - - postgres -``` - -## Manually trigger a backup - -`docker exec -it pgbackup ./backup.sh` - -## Restore from latest backup - -If the database already exists, drop it. -Create a database - -```bash -docker exec -it /bin/sh -c "zcat /storage/backups/postgres/last/-latest.sql.gz | psql --username= --dbname= -W" -``` +# pgBackup + +[![Docker Pulls](https://img.shields.io/docker/pulls/prodrigestivill/postgres-backup-local?style=flat-square&color=607D8B&label=docker%20pulls&logo=docker)](https://hub.docker.com/r/prodrigestivill/postgres-backup-local) +[![GitHub Stars](https://img.shields.io/github/stars/prodrigestivill/docker-postgres-backup-local?style=flat-square&color=607D8B&label=github%20stars&logo=github)](https://github.com/prodrigestivill/docker-postgres-backup-local) +[![Compose Templates](https://img.shields.io/static/v1?style=flat-square&color=607D8B&label=compose&message=templates)](https://github.com/GhostWriters/DockSTARTer/tree/master/compose/.apps/pgbackup) + +## Description + +[pgBackup](https://hub.docker.com/r/prodrigestivill/postgres-backup-local): Backup PostgresSQL to the local filesystem with periodic rotating backups + +## Install/Setup + +Set your postgres host, username and password in the .env file along with a comma seperated list of databases you want to backup. + +By default, backups run daily. Change PGBACKUP_SCHEDULE to any valid [cron schedule](http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules) to modify the default. + +### Recommended docker-compose overrides + +For extra security, it is recommended to limit permissions on the backup folder to a priviledged user. Modify docker-compose.override.yml as below. + +If you are using postgres docker container, add a dependency to the container + +```yaml + pgbackup: + user: postgres:postgres + depends_on: + - postgres +``` + +## Manually trigger a backup + +`docker exec -it pgbackup ./backup.sh` + +## Restore from latest backup + +If the database already exists, drop it. +Create a database + +```bash +docker exec -it /bin/sh -c "zcat /storage/backups/postgres/last/-latest.sql.gz | psql --username= --dbname= -W" +``` diff --git a/docs/apps/postgres.md b/docs/apps/postgres.md index ab31b252ae..c4314f93a6 100644 --- a/docs/apps/postgres.md +++ b/docs/apps/postgres.md @@ -1,39 +1,39 @@ -# PostgresSQL - -[![Docker Pulls](https://img.shields.io/docker/pulls/_/postgres?style=flat-square&color=607D8B&label=docker%20pulls&logo=docker)](https://hub.docker.com/r/_/postgres) -[![GitHub Stars](https://img.shields.io/github/stars/docker-library/postgres?style=flat-square&color=607D8B&label=github%20stars&logo=github)](https://github.com/docker-library/postgres) -[![Compose Templates](https://img.shields.io/static/v1?style=flat-square&color=607D8B&label=compose&message=templates)](https://github.com/GhostWriters/DockSTARTer/tree/master/compose/.apps/postgres) - -## Description - -[Postgres](https://www.postgresql.org/): The World's Most Advanced Open Source Relational Database - -## Install/Setup - -PostgreSQL is a powerful, open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance. - -There is a wealth of information to be found describing how to [install](https://www.postgresql.org/download/) and [use](https://www.postgresql.org/docs/) PostgreSQL through the [official documentation](https://www.postgresql.org/docs/). The [open source community](https://www.postgresql.org/community/) provides many helpful places to become familiar with PostgreSQL, discover how it works. - -We **heavily** recommend that if you spin up a container that requires a database you create a user for that container. You should **NEVER** use the root account for anything other than database management. - -Strongly consider also installing [pgAdmin](https://github.com/GhostWriters/DockSTARTer/tree/master/compose/.apps/pgadmin) for adminsitration and [pgBackup](https://github.com/GhostWriters/DockSTARTer/tree/master/compose/.apps/pgbackup) for periodic rotating backups. - -## Common Activities - -### Create user - -``` sql -CREATE USER newuser WITH PASSWORD 'password123'; -``` - -### Make user a superuser - -``` sql -CREATE USER newadmin WITH PASSWORD 'password123'; -ALTER USER newadmin WITH SUPERUSER; -``` - -### Create a database and owner to the new user - -CREATE DATABASE newdatabase; -ALTER DATABASE newdatabase OWNER TO newuser; +# PostgresSQL + +[![Docker Pulls](https://img.shields.io/docker/pulls/_/postgres?style=flat-square&color=607D8B&label=docker%20pulls&logo=docker)](https://hub.docker.com/r/_/postgres) +[![GitHub Stars](https://img.shields.io/github/stars/docker-library/postgres?style=flat-square&color=607D8B&label=github%20stars&logo=github)](https://github.com/docker-library/postgres) +[![Compose Templates](https://img.shields.io/static/v1?style=flat-square&color=607D8B&label=compose&message=templates)](https://github.com/GhostWriters/DockSTARTer/tree/master/compose/.apps/postgres) + +## Description + +[Postgres](https://www.postgresql.org/): The World's Most Advanced Open Source Relational Database + +## Install/Setup + +PostgreSQL is a powerful, open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance. + +There is a wealth of information to be found describing how to [install](https://www.postgresql.org/download/) and [use](https://www.postgresql.org/docs/) PostgreSQL through the [official documentation](https://www.postgresql.org/docs/). The [open source community](https://www.postgresql.org/community/) provides many helpful places to become familiar with PostgreSQL, discover how it works. + +We **heavily** recommend that if you spin up a container that requires a database you create a user for that container. You should **NEVER** use the root account for anything other than database management. + +Strongly consider also installing [pgAdmin](https://github.com/GhostWriters/DockSTARTer/tree/master/compose/.apps/pgadmin) for adminsitration and [pgBackup](https://github.com/GhostWriters/DockSTARTer/tree/master/compose/.apps/pgbackup) for periodic rotating backups. + +## Common Activities + +### Create user + +``` sql +CREATE USER newuser WITH PASSWORD 'password123'; +``` + +### Make user a superuser + +``` sql +CREATE USER newadmin WITH PASSWORD 'password123'; +ALTER USER newadmin WITH SUPERUSER; +``` + +### Create a database and owner to the new user + +CREATE DATABASE newdatabase; +ALTER DATABASE newdatabase OWNER TO newuser;