From a4c7d803b17f78ef7cc170135c7bcb51c3ef6cde Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Fri, 24 Sep 2021 22:11:04 +0900 Subject: [PATCH] Add new environment variable "POSTGRES_DATABASE". --- Dockerfile | 3 ++- README.md | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2b9e8ce..0aae7f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ LABEL maintainer="Bo Peng " ENV POSTGRES_USERNAME postgres ENV POSTGRES_PASSWORD postgres +ENV POSTGRES_DATABASE postgres ENV PGPOOL_SERVICE localhost ENV PGPOOL_SERVICE_PORT 9999 @@ -10,6 +11,6 @@ ENV PGPOOL_SERVICE_PORT 9999 COPY pgpool2_exporter /bin/pgpool2_exporter -CMD ["/bin/sh", "-c", "export DATA_SOURCE_NAME=\"postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${PGPOOL_SERVICE}:${PGPOOL_SERVICE_PORT}/postgres?sslmode=disable\" ; /bin/pgpool2_exporter"] +CMD ["/bin/sh", "-c", "export DATA_SOURCE_NAME=\"postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${PGPOOL_SERVICE}:${PGPOOL_SERVICE_PORT}/${POSTGRES_DATABASE}?sslmode=disable\" ; /bin/pgpool2_exporter"] EXPOSE 9719 diff --git a/README.md b/README.md index 642aceb..ca36932 100644 --- a/README.md +++ b/README.md @@ -53,10 +53,13 @@ This package is available for Docker. The following environment variables config * `POSTGRES_PASSWORD` PostgreSQL user password. Default is `postgres`. - + +* `POSTGRES_DATABASE` + Database name. Default is `postgres`. + * `PGPOOL_SERVICE` Pgpool-II hostname. Default is `localhost`. - + * `PGPOOL_SERVICE_PORT` Pgpool-II port number. Default is `9999`. @@ -65,6 +68,7 @@ docker run --name pgpool2_exporter \ --net=host --rm \ -e POSTGRES_USERNAME= \ -e POSTGRES_PASSWORD= \ + -e POSTGRES_DATABASE= \ -e PGPOOL_SERVICE= \ -e PGPOOL_SERVICE_PORT= \ pgpool/pgpool2_exporter:latest