This docker image defines and configures the PgBouncer connection pooler for PostgreSQL, with a set of sensible defaults. These defaults are insecure and should be modified to suit your needs, specifically in pgbouncer.ini and userlist.txt.
Built for use in the pgbouncer k8s charm.
- in one terminal, run the following:
docker pull postgres/postgresdocker run --rm -P -e POSTGRES_PASSWORD=pw --name pg --hostname pg-host postgres
- in another terminal:
docker build -t pgbouncer:local .docker run -it --rm --env-file <your_env_file> --name pgbouncer pgbouncer:local
Pgbouncer won't run without the following environment variables passed in:
$PGB_DATABASES- A string detailing the database config.
- Schema available in the pgbouncer documentation.
- No default provided.
$PGB_LISTEN_PORT- Port on which PgBouncer listens for traffic.
- Default = 6432
$PGB_LISTEN_ADDR- Address at which PgBouncer listens for traffic.
- Default = 0.0.0.0
$PGB_ADMIN_USERS- Comma-separated list of admin users.
- Default = "admin"
$PGB_ADMIN_PASSWORDS- Comma-separated list of admin passwords, corresponding to
$PGB_ADMIN_USERS - These will be encrypted in future.
- A default "pw" is provided if the default
$PGB_ADMIN_USERSvalue is used, but otherwise no default is provided.
- Comma-separated list of admin passwords, corresponding to