Files
templates/blueprints/postgres-pgadmin/template.toml
T
9c784b723e feat: add postgres-pgadmin template (#1104)
* feat: add postgres-pgadmin template

* feat: expose postgres via second domain

Add postgres_domain variable and second [[config.domains]] for
postgres:5432 alongside pgadmin:80, so both the DB and the web UI
are reachable via Dokploy domains.

* fix(postgres-pgadmin): drop HTTP domain on postgres:5432, pre-register server in pgAdmin, bump pgAdmin to 9.17

- Remove the second [[config.domains]] pointing an HTTP host at postgres:5432 (Traefik returned 502).
- Mount servers.json + pgpass via config.mounts so pgAdmin comes with the bundled PostgreSQL pre-registered and connects without a password prompt (pgpass is copied to the data volume with 0600 for uid 5050).
- Bump dpage/pgadmin4 8.13 -> 9.17.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Mauricio Siu <mauricio@dokploy.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-24 20:34:46 -06:00

45 lines
1.0 KiB
TOML

[variables]
pgadmin_domain = "${domain}"
postgres_user = "${username}"
postgres_password = "${password:32}"
postgres_db = "postgres"
pgadmin_email = "${email}"
pgadmin_password = "${password:16}"
[config]
[[config.domains]]
serviceName = "pgadmin"
port = 80
host = "${pgadmin_domain}"
[config.env]
POSTGRES_USER = "${postgres_user}"
POSTGRES_PASSWORD = "${postgres_password}"
POSTGRES_DB = "${postgres_db}"
PGADMIN_DEFAULT_EMAIL = "${pgadmin_email}"
PGADMIN_DEFAULT_PASSWORD = "${pgadmin_password}"
# Pre-register the bundled PostgreSQL server in pgAdmin (imported on first launch only).
[[config.mounts]]
filePath = "/servers.json"
content = """{
"Servers": {
"1": {
"Name": "PostgreSQL",
"Group": "Servers",
"Host": "postgres",
"Port": 5432,
"MaintenanceDB": "${postgres_db}",
"Username": "${postgres_user}",
"PassFile": "/var/lib/pgadmin/pgpass",
"SSLMode": "prefer"
}
}
}
"""
[[config.mounts]]
filePath = "/pgpass"
content = """postgres:5432:*:${postgres_user}:${postgres_password}
"""