| 1 | amends "../../config/Service.pkl" |
| 2 | |
| 3 | import "service.pkl" as postgres |
| 4 | import "../../config/site.pkl" as site |
| 5 | |
| 6 | meta { name = "pgAdmin" } |
| 7 | healthyDeadline = "15m" |
| 8 | requirements { new postgres.AdminConnection {} } |
| 9 | |
| 10 | secrets { |
| 11 | ["password"] {} |
| 12 | } |
| 13 | |
| 14 | container { |
| 15 | image = "docker.io/dpage/pgadmin4@sha256:33eb7d070ee7500d1513453773f61df1256fdea08257d4a3f4aebd8cf1cc87cf" |
| 16 | entrypoint = "/bin/sh" |
| 17 | args { "/studio/start.sh" } |
| 18 | cpu = 150 |
| 19 | memory = 512 |
| 20 | |
| 21 | http { |
| 22 | containerPort = 5050 |
| 23 | subdomain = "pg" |
| 24 | authRole = "infra-admin" |
| 25 | checkPath = "/misc/ping" |
| 26 | } |
| 27 | |
| 28 | volumes { |
| 29 | ["/var/lib/pgadmin"] {} |
| 30 | ["/studio/start.sh"] { config = "start.sh" } |
| 31 | } |
| 32 | |
| 33 | env { |
| 34 | ["PGADMIN_DEFAULT_EMAIL"] = site.ownerEmail |
| 35 | ["PGADMIN_CONFIG_DESKTOP_USER"] = "\"\(site.ownerEmail)\"" |
| 36 | ["PGADMIN_DEFAULT_PASSWORD"] = "${secret.own.password}" |
| 37 | ["PGADMIN_CONFIG_SERVER_MODE"] = "False" |
| 38 | ["PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED"] = "False" |
| 39 | ["PGADMIN_CUSTOM_CONFIG_DISTRO_FILE"] = "/tmp/config_distro.py" |
| 40 | ["PGADMIN_DISABLE_POSTFIX"] = "True" |
| 41 | ["PGADMIN_LISTEN_PORT"] = "5050" |
| 42 | ["PGADMIN_REPLACE_SERVERS_ON_STARTUP"] = "True" |
| 43 | ["POSTGRES_PASSWORD"] = "${secret.admin.password}" |
| 44 | } |
| 45 | |
| 46 | envTemplate = """ |
| 47 | {{ range nomadService 1 (env "NOMAD_ALLOC_ID") "postgres" }}POSTGRES_HOST={{ .Address }} |
| 48 | POSTGRES_PORT={{ .Port }}{{ end }} |
| 49 | """ |
| 50 | } |