Use configured port for postgres pooler

This commit is contained in:
Daniel Berteaud 2024-01-19 15:09:59 +01:00
parent b2a0de3a67
commit 4996bc9e57
3 changed files with 2 additions and 3 deletions

View File

@ -1,4 +1,4 @@
FROM danielberteaud/alpine:24.1-2
FROM danielberteaud/alpine:24.1-6
MAINTAINER Daniel Berteaud <dbd@ehtrace.com>
ARG MINIFLUX_VERSION=2.0.51

View File

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

View File

@ -86,7 +86,7 @@ job [[ .instance | toJSON ]] {
data =<<_EOT
DATABASE_URL=postgresql://
[[- if ne $c.postgres.pooler.engine "none" -]]
[[ .instance ]]:{{ env "NOMAD_ALLOC_ID" }}@127.0.0.1:6432/[[ $c.postgres.database ]]?sslmode=disable
[[ .instance ]]:{{ env "NOMAD_ALLOC_ID" }}@127.0.0.1:[[ $c.postgres.pooler.port ]]/[[ $c.postgres.database ]]?sslmode=disable
[[- else -]]
[[ $c.postgres.user ]]:[[ $c.postgres.password ]]@[[ $c.postgres.host ]]:[[ $c.postgres.port ]]/[[ $c.postgres.database ]]?sslmode=disable
[[- end ]]