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