Skip to content

higgs01/pgbouncer

Repository files navigation

PGBouncer Docker image

GitHub Tag

This is a alpine-based docker-image for PgBouncer.

Features

  • Lightweight (only ~13MB)
  • envsubst for pgbouncer.ini and userlist.txt to allow injecting secrets at runtime
    • if the source-files change envsubst will be triggered again

Usage

docker run \
    -p 5432:5432 \
    -v /etc/pgbouncer/input:/etc/pgbouncer/input # volume containing pgbouncer.ini and userlist.txt
    ghcr.io/higgs01/pgbouncer:latest

For an example see docker-compose.dev.yml

Config

This image doesn't provide a default configuration. Therefore you have to supply a pgbouncer.ini and mount it as seen above.

Environment-Variables

To inject secrets during runtime set those secret as an env-var and reference those in pgbouncer.inianduserlist.txt`

Example:

# docker-compose.yml
services:
  pgbouncer:
    build: .
    volumes:
      - ./config:/etc/pgbouncer/input
    environment:
      POSTGRES_PASSWORD: password
# userlist.txt
"postgres" "$POSTGRES_PASSWORD"

This will then be rendered like this

# userlist.txt
"postgres" "password"

using envsubst

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors