1
0
forked from erp-dev/erp
This commit is contained in:
2025-12-24 23:12:56 +08:00
parent 51f2ffd02a
commit 3674ef72fa
6 changed files with 48 additions and 45 deletions

View File

@@ -17,29 +17,18 @@ services:
pgbouncer:
image: pgbouncer/pgbouncer:latest
container_name: pgbouncer
# 配置文件已包含所有配置,环境变量仅作为备用
environment:
POSTGRES_HOST: postgres
POSTGRES_PORT: "5432"
POSTGRES_DB: flower
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
# 如果镜像支持环境变量配置,这些可以作为备用
DATABASES_HOST: postgres
DATABASES_PORT: "5432"
DATABASES_USER: postgres
DATABASES_PASSWORD: postgres
DATABASES_DBNAME: flower
PGBOUNCER_POOL_MODE: transaction
PGBOUNCER_MAX_CLIENT_CONN: "100"
PGBOUNCER_DEFAULT_POOL_SIZE: "25"
PGBOUNCER_MIN_POOL_SIZE: "5"
PGBOUNCER_RESERVE_POOL_SIZE: "5"
PGBOUNCER_RESERVE_POOL_TIMEOUT: "3"
PGBOUNCER_SERVER_IDLE_TIMEOUT: "600"
PGBOUNCER_LOG_CONNECTIONS: "1"
PGBOUNCER_LOG_DISCONNECTIONS: "1"
PGBOUNCER_LOG_POOLER_ERRORS: "1"
ports:
- "6432:6432"
volumes:
- ./pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini
depends_on:
- postgres
restart: unless-stopped