Use configured port for postgress pooler

This commit is contained in:
Daniel Berteaud 2024-01-19 15:19:20 +01:00
parent a0ef85662c
commit 9cef0d414f
3 changed files with 2 additions and 3 deletions

View File

@ -34,7 +34,7 @@ RUN set -euxo pipefail &&\
mv web-vault / &&\
chown -R root:root /web-vault
FROM danielberteaud/alpine:24.1-2
FROM danielberteaud/alpine:24.1-6
MAINTAINER Daniel Berteaud <dbd@ehtrace.com>
ENV ROCKET_PROFILE=release \

View File

@ -145,7 +145,6 @@ _EOT
env = true
}
# Use a template block instead of env {} so we can fetch values from vault
template {
data = <<_EOT

View File

@ -85,7 +85,7 @@ job "[[ .instance ]]" {
template {
data =<<_EOT
[[- if ne $c.postgres.pooler.engine "none" ]]
DATABASE_URL=postgresql://[[ .instance ]]:{{ env "NOMAD_ALLOC_ID" }}@localhost:6432/[[ $c.postgres.database ]]
DATABASE_URL=postgresql://[[ .instance ]]:{{ env "NOMAD_ALLOC_ID" }}@localhost:[[ $c.postgres.pooler.port ]]/[[ $c.postgres.database ]]
[[- else ]]
DATABASE_URL=postgresql://[[ $c.postgres.user ]]:[[ $c.postgres.password | regexp.Replace "\\.Data\\.password" "urlquery .Data.password" ]]@[[ $c.postgres.host ]]:[[ $c.postgres.port ]]/[[ $c.postgres.database ]]]
[[- end ]]