Skip to content

Commit

Permalink
Add new environment variable "POSTGRES_DATABASE".
Browse files Browse the repository at this point in the history
  • Loading branch information
pengbo0328 committed Sep 24, 2021
1 parent f0426d5 commit a4c7d80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ LABEL maintainer="Bo Peng <pengbo@sraoss.co.jp>"

ENV POSTGRES_USERNAME postgres
ENV POSTGRES_PASSWORD postgres
ENV POSTGRES_DATABASE postgres
ENV PGPOOL_SERVICE localhost
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
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand All @@ -65,6 +68,7 @@ docker run --name pgpool2_exporter \
--net=host --rm \
-e POSTGRES_USERNAME=<username> \
-e POSTGRES_PASSWORD=<password> \
-e POSTGRES_DATABASE=<database> \
-e PGPOOL_SERVICE=<hostname> \
-e PGPOOL_SERVICE_PORT=<port> \
pgpool/pgpool2_exporter:latest
Expand Down

0 comments on commit a4c7d80

Please sign in to comment.