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

@@ -18,29 +18,17 @@ services:
pgbouncer:
image: pgbouncer/pgbouncer:latest
container_name: pgbouncer
# 配置文件已包含所有配置,环境变量仅作为备用
environment:
POSTGRES_HOST: postgres
POSTGRES_PORT: "${POSTGRES_PORT:-5432}"
POSTGRES_DB: ${POSTGRES_DB:-flower}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
DATABASES_HOST: postgres
DATABASES_PORT: "${POSTGRES_PORT:-5432}"
DATABASES_USER: ${POSTGRES_USER:-postgres}
DATABASES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
DATABASES_DBNAME: ${POSTGRES_DB:-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:
- "${PGBOUNCER_PORT:-6432}:6432"
volumes:
- ./pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini
depends_on:
- postgres
restart: unless-stopped