Docker: Run PgBouncer using Docker Compose Connecting to a PostgreSQL directly is the easiest way. But sometimes, you need a Connection Pool. This is how you can use PgBouncer in Docker Compose.