From 34f99cefaf27c1a87f2a1bab4d650ebf1301b024 Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Wed, 16 Aug 2023 06:21:05 +0100 Subject: [PATCH] pgadmin config. --- services/postgres.hcl | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/services/postgres.hcl b/services/postgres.hcl index 2372efc..5710608 100644 --- a/services/postgres.hcl +++ b/services/postgres.hcl @@ -9,6 +9,7 @@ job "postgres" { port "exporter" { to = 9187 } + port "admin" { } } task "postgres" { @@ -59,6 +60,33 @@ job "postgres" { tags = ["metrics"] } } + + task "pgadmin" { + driver = "docker" + + config { + image = "dpage/pgadmin4:latest" + ports = ["admin"] + volumes = [ "/data/compute/appdata/pgadmin:/var/lib/pgadmin" ] + } + + env { + PGADMIN_LISTEN_PORT = "${NOMAD_PORT_admin}" + PGADMIN_DEFAULT_EMAIL = "${var.default_email}" + PGADMIN_DEFAULT_PASSWORD = "${var.default_password}" + PGADMIN_DISABLE_POSTFIX = "true" + PGADMIN_CONFIG_MAIL_SERVER = "'192.168.1.1'" + } + + service { + name = "pgadmin" + port = "admin" + tags = [ + "traefik.enable=true", + "traefik.http.routers.pgadmin.entryPoints=websecure", + ] + } + } } } @@ -66,3 +94,13 @@ variable "pg_password" { type = string default = "Faelaishewohlees4nei" } + +variable "default_email" { + type = string + default = "petru@paler.net" +} + +variable "default_password" { + type = string + default = "ahheina6aeki3Hu0aht3" +}