Skip to content

Commit

Permalink
add support to postgres 14.2
Browse files Browse the repository at this point in the history
  • Loading branch information
joubertredrat committed Apr 23, 2022
1 parent fa904de commit d1ef0cf
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ postgres13.2-info:
@echo " DbGate: http://0.0.0.0:${DEVBOX_POSTGRES132_DBGATE_EXPORT_PORT}"
@echo

include postgres/14.2/Makefile

redis6.2-up:
docker-compose -f redis/6.2/docker-compose.yml -p ${DEVBOX_PROJECT_NAME} up -d

Expand Down
65 changes: 65 additions & 0 deletions postgres/14.2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
DEVBOX_POSTGRES142_POSTGRES_USER ?= postgres
DEVBOX_POSTGRES142_POSTGRES_PASSWORD ?= password
DEVBOX_POSTGRES142_POSTGRES_DB ?= dev
DEVBOX_POSTGRES142_DB_EXPORT_PORT ?= 15442
DEVBOX_POSTGRES142_PGADMIN_EXPORT_PORT ?= 15443
DEVBOX_POSTGRES142_PGADMIN_EMAIL ?= [email protected]
DEVBOX_POSTGRES142_PGADMIN_PASSWORD ?= password
DEVBOX_POSTGRES142_PGWEB_EXPORT_PORT ?= 15444
DEVBOX_POSTGRES142_DBGATE_EXPORT_PORT ?= 15445

postgres14.2-up:
docker-compose -f postgres/14.2/docker-compose.yml -p ${DEVBOX_PROJECT_NAME} up -d

postgres14.2-down:
docker-compose -f postgres/14.2/docker-compose.yml -p ${DEVBOX_PROJECT_NAME} down

postgres14.2-status:
docker-compose -f postgres/14.2/docker-compose.yml -p ${DEVBOX_PROJECT_NAME} ps

postgres14.2-logs:
docker-compose -f postgres/14.2/docker-compose.yml -p ${DEVBOX_PROJECT_NAME} logs -f

postgres14.2-purge:
docker-compose -f postgres/14.2/docker-compose.yml -p ${DEVBOX_PROJECT_NAME} down --volumes

postgres14.2-help:
@echo
@echo "Commands:"
@echo
@echo " make postgres14.2-up Start Postgres 14.2 service and management tools"
@echo " make postgres14.2-down Stop Postgres 14.2 service and management tools"
@echo " make postgres14.2-status Status from running services"
@echo " make postgres14.2-logs Logs from running services"
@echo " make postgres14.2-purge Delete all Postgres 14.2 data"
@echo " make postgres14.2-info Information about the services for use"
@echo " make postgres14.2-help This help :)"
@echo
@echo "Available configurable environment variables:"
@echo
@echo " DEVBOX_POSTGRES142_POSTGRES_USER Default admin user"
@echo " DEVBOX_POSTGRES142_POSTGRES_PASSWORD Default ${DEVBOX_POSTGRES142_POSTGRES_USER} password"
@echo " DEVBOX_POSTGRES142_POSTGRES_DB Default database"
@echo " DEVBOX_POSTGRES142_DB_EXPORT_PORT Port to expose Postgres 14.2 in docker for your environment"
@echo " DEVBOX_POSTGRES142_PGADMIN_EXPORT_PORT Port to expose PgAdmin in docker for access in your browser"
@echo " DEVBOX_POSTGRES142_PGADMIN_EMAIL E-mail to login in PgAdmin in browser"
@echo " DEVBOX_POSTGRES142_PGADMIN_PASSWORD Password to login in PgAdmin in browser"
@echo " DEVBOX_POSTGRES142_PGWEB_EXPORT_PORT Port to expose Pgweb in docker for access in your browser"
@echo " DEVBOX_POSTGRES142_DBGATE_EXPORT_PORT Port to expose DbGate in docker for access in your browser"
@echo

postgres14.2-info:
@echo
@echo "Postgres 14.2 information"
@echo
@echo " Host: 0.0.0.0"
@echo " Port: ${DEVBOX_POSTGRES142_DB_EXPORT_PORT}"
@echo " User: ${DEVBOX_POSTGRES142_POSTGRES_USER}"
@echo " Password: ${DEVBOX_POSTGRES142_POSTGRES_PASSWORD}"
@echo " Database: ${DEVBOX_POSTGRES142_POSTGRES_DB}"
@echo " PgAdmin: http://0.0.0.0:${DEVBOX_POSTGRES142_PGADMIN_EXPORT_PORT}"
@echo " PgAdmin user: ${DEVBOX_POSTGRES142_PGADMIN_EMAIL}"
@echo " PgAdmin password: ${DEVBOX_POSTGRES142_PGADMIN_PASSWORD}"
@echo " Pgweb: http://0.0.0.0:${DEVBOX_POSTGRES142_PGWEB_EXPORT_PORT}"
@echo " DbGate: http://0.0.0.0:${DEVBOX_POSTGRES142_DBGATE_EXPORT_PORT}"
@echo
1 change: 1 addition & 0 deletions postgres/14.2/config/pgpassfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
db.postgres142.devbox.local:5432:dev:postgres:password
21 changes: 21 additions & 0 deletions postgres/14.2/config/servers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"Servers": {
"1": {
"Name": "db.postgres142.devbox.local",
"Group": "Servers",
"Host": "db.postgres142.devbox.local",
"Port": 5432,
"MaintenanceDB": "postgres",
"Username": "postgres",
"PassFile": "/pgadmin4/pgpassfile",
"SSLMode": "prefer",
"SSLCert": "<STORAGE_DIR>/.postgresql/postgresql.crt",
"SSLKey": "<STORAGE_DIR>/.postgresql/postgresql.key",
"SSLCompression": 0,
"Timeout": 10,
"UseSSHTunnel": 0,
"TunnelPort": "22",
"TunnelAuthentication": 0
}
}
}
67 changes: 67 additions & 0 deletions postgres/14.2/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
version: "3.8"

services:
db.postgres142.devbox.local:
image: postgres:14.2-alpine
environment:
POSTGRES_USER: ${DEVBOX_POSTGRES142_POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${DEVBOX_POSTGRES142_POSTGRES_PASSWORD:-password}
POSTGRES_DB: ${DEVBOX_POSTGRES142_POSTGRES_DB:-dev}
volumes:
- postgres142_db_data:/var/lib/postgresql/data
networks:
- postgres142_network_local
ports:
- ${DEVBOX_POSTGRES142_DB_EXPORT_PORT:-15442}:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 10s
retries: 3
pgadmin.postgres142.devbox.local:
image: dpage/pgadmin4:5
depends_on:
- db.postgres142.devbox.local
environment:
PGADMIN_DEFAULT_EMAIL: ${DEVBOX_POSTGRES142_PGADMIN_EMAIL:[email protected]}
PGADMIN_DEFAULT_PASSWORD: ${DEVBOX_POSTGRES142_PGADMIN_PASSWORD:-password}
volumes:
- ./config/servers.json:/pgadmin4/servers.json
- ./config/pgpassfile:/pgadmin4/pgpassfile
networks:
- postgres142_network_local
ports:
- ${DEVBOX_POSTGRES142_PGADMIN_EXPORT_PORT:-15443}:80
pgweb.postgres142.devbox.local:
image: sosedoff/pgweb:latest
depends_on:
- db.postgres142.devbox.local
environment:
DATABASE_URL: postgres://${DEVBOX_POSTGRES142_POSTGRES_USER:-postgres}:${DEVBOX_POSTGRES142_POSTGRES_PASSWORD:-password}@db.postgres142.devbox.local:5432/${DEVBOX_POSTGRES142_POSTGRES_DB:-dev}?sslmode=disable
networks:
- postgres142_network_local
ports:
- ${DEVBOX_POSTGRES132_PGWEB_EXPORT_PORT:-15444}:8081
dbgate.postgres142.devbox.local:
image: dbgate/dbgate:alpine
depends_on:
- db.postgres142.devbox.local
environment:
CONNECTIONS: postgres1
ENGINE_postgres1: postgres@dbgate-plugin-postgres
LABEL_postgres1: db.postgres142.devbox.local
SERVER_postgres1: db.postgres142.devbox.local
PORT_postgres1: 5432
USER_postgres1: ${DEVBOX_POSTGRES142_POSTGRES_USER:-postgres}
PASSWORD_postgres1: ${DEVBOX_POSTGRES142_POSTGRES_PASSWORD:-password}
networks:
- postgres142_network_local
ports:
- ${DEVBOX_POSTGRES142_DBGATE_EXPORT_PORT:-15445}:3000

volumes:
postgres142_db_data:

networks:
postgres142_network_local:
driver: bridge
7 changes: 4 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ Download or clone this repository and run `make help` to see all informations.

## Dependencies

* make
* docker
* docker-compose
* [make](https://www.gnu.org/software/make/)
* [docker](https://www.docker.com/)
* [docker-compose](https://pypi.org/project/docker-compose/)

## Services supported

* MySQL [5.7](https://dev.mysql.com/doc/relnotes/mysql/5.7/en/)
* MariaDB [10.5](https://mariadb.com/kb/en/mariadb-server-105/)
* Postgres [13.2](https://www.postgresql.org/docs/13/release-13-2.html)
* Postgres [14.2](https://www.postgresql.org/docs/14/release-14-2.html)
* Redis [6.2](https://redis.io)
* MongoDB [4.4](https://docs.mongodb.com/manual/release-notes/4.4/)
* [MinIO](https://min.io/)
Expand Down

0 comments on commit d1ef0cf

Please sign in to comment.