Add pgbouncer config

This commit is contained in:
Max Wofford 2025-04-28 11:01:47 -04:00
parent 9a110f5326
commit d547f0aab5
2 changed files with 26 additions and 0 deletions

View file

@ -19,6 +19,7 @@ WAREHOUSE_DATABASE_URL=your_warehouse_database_url_here
# You can leave this alone if you're using the provided docker setup!
DATABASE_URL=your_database_url_here
POOL_DATABASE_URL=pg_bouncer_url_here
# Secret key base
SECRET_KEY_BASE=your_secret_key_base_here

View file

@ -0,0 +1,25 @@
version: '3.8'
# This is run on coolify under a seperate service so we don't restart it on
# every git push!
services:
pgbouncer:
image: edoburu/pgbouncer:v1.24.0-p1
environment:
- DB_USER=${DB_USER:-postgres}
- DB_PASSWORD=${DB_PASSWORD}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT:-6382}
- DB_NAME=${DB_NAME:-postgres}
- POOL_MODE=transaction
- MAX_CLIENT_CONN=1000
- DEFAULT_POOL_SIZE=20
- MIN_POOL_SIZE=5
- AUTH_TYPE=scram-sha-256
- ADMIN_USERS=${DB_USER:-postgres}
ports:
- "6432:6432"
healthcheck:
test: ["CMD", "pg_isready", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5