diff --git a/celerybeat-schedule-shm b/celerybeat-schedule-shm index 1066fc0..fcecce3 100644 Binary files a/celerybeat-schedule-shm and b/celerybeat-schedule-shm differ diff --git a/celerybeat-schedule-wal b/celerybeat-schedule-wal index e66321a..93762ec 100644 Binary files a/celerybeat-schedule-wal and b/celerybeat-schedule-wal differ diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 3ce8cbe..d943d7a 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -23,17 +23,35 @@ services: pgbouncer: image: pgbouncer/pgbouncer:latest container_name: pgbouncer - # 配置文件已包含所有配置,环境变量仅作为备用 + # 使用环境变量配置,让镜像自动生成配置文件 environment: - DATABASES_HOST: postgres - DATABASES_PORT: "5432" - DATABASES_USER: postgres - DATABASES_PASSWORD: postgres - DATABASES_DBNAME: flower + # 数据库连接配置(格式:数据库名=host=主机 port=端口 dbname=数据库名 user=用户 password=密码) + DATABASES: flower=host=postgres port=5432 dbname=flower user=postgres password=postgres + # PgBouncer 基本配置 + PGBOUNCER_LISTEN_ADDR: 0.0.0.0 + PGBOUNCER_LISTEN_PORT: 6432 + PGBOUNCER_AUTH_TYPE: trust + # 连接池配置 + 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_CONNECT_TIMEOUT: "15" + PGBOUNCER_SERVER_IDLE_TIMEOUT: "600" + PGBOUNCER_QUERY_TIMEOUT: "0" + PGBOUNCER_QUERY_WAIT_TIMEOUT: "120" + # 日志配置 + PGBOUNCER_LOG_CONNECTIONS: "1" + PGBOUNCER_LOG_DISCONNECTIONS: "1" + PGBOUNCER_LOG_POOLER_ERRORS: "1" + # 其他设置 + PGBOUNCER_IGNORE_STARTUP_PARAMETERS: extra_float_digits + PGBOUNCER_APPLICATION_NAME_ADD_HOST: "1" ports: - "6432:6432" - volumes: - - ./pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini:ro # 确保 postgres 完全启动后再启动 pgbouncer depends_on: postgres: diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index b4e3db5..366bea1 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -26,9 +26,35 @@ services: pgbouncer: image: pgbouncer/pgbouncer:latest container_name: pgbouncer - # 配置文件已包含所有配置,环境变量仅作为备用 - volumes: - - ./pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini:ro + # 使用环境变量配置,让镜像自动生成配置文件 + environment: + # 数据库连接配置(格式:数据库名=host=主机 port=端口 dbname=数据库名 user=用户 password=密码) + DATABASES: flower=host=postgres port=${POSTGRES_PORT:-5432} dbname=${POSTGRES_DB:-flower} user=${POSTGRES_USER:-postgres} password=${POSTGRES_PASSWORD:-postgres} + # PgBouncer 基本配置 + PGBOUNCER_LISTEN_ADDR: 0.0.0.0 + PGBOUNCER_LISTEN_PORT: 6432 + PGBOUNCER_AUTH_TYPE: trust + # 连接池配置 + 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_CONNECT_TIMEOUT: "15" + PGBOUNCER_SERVER_IDLE_TIMEOUT: "600" + PGBOUNCER_QUERY_TIMEOUT: "0" + PGBOUNCER_QUERY_WAIT_TIMEOUT: "120" + # 日志配置 + PGBOUNCER_LOG_CONNECTIONS: "1" + PGBOUNCER_LOG_DISCONNECTIONS: "1" + PGBOUNCER_LOG_POOLER_ERRORS: "1" + # 其他设置 + PGBOUNCER_IGNORE_STARTUP_PARAMETERS: extra_float_digits + PGBOUNCER_APPLICATION_NAME_ADD_HOST: "1" + ports: + - "${PGBOUNCER_PORT:-6432}:6432" # 确保 postgres 完全启动后再启动 pgbouncer depends_on: postgres: diff --git a/docker-compose.yml b/docker-compose.yml index d88d677..3c55638 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,18 +23,35 @@ services: pgbouncer: image: pgbouncer/pgbouncer:latest container_name: pgbouncer - # 配置文件已包含所有配置,环境变量仅作为备用 + # 使用环境变量配置,让镜像自动生成配置文件 environment: - # 如果镜像支持环境变量配置,这些可以作为备用 - DATABASES_HOST: postgres - DATABASES_PORT: "5432" - DATABASES_USER: postgres - DATABASES_PASSWORD: postgres - DATABASES_DBNAME: flower + # 数据库连接配置(格式:数据库名=host=主机 port=端口 dbname=数据库名 user=用户 password=密码) + DATABASES: flower=host=postgres port=5432 dbname=flower user=postgres password=postgres + # PgBouncer 基本配置 + PGBOUNCER_LISTEN_ADDR: 0.0.0.0 + PGBOUNCER_LISTEN_PORT: 6432 + PGBOUNCER_AUTH_TYPE: trust + # 连接池配置 + 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_CONNECT_TIMEOUT: "15" + PGBOUNCER_SERVER_IDLE_TIMEOUT: "600" + PGBOUNCER_QUERY_TIMEOUT: "0" + PGBOUNCER_QUERY_WAIT_TIMEOUT: "120" + # 日志配置 + PGBOUNCER_LOG_CONNECTIONS: "1" + PGBOUNCER_LOG_DISCONNECTIONS: "1" + PGBOUNCER_LOG_POOLER_ERRORS: "1" + # 其他设置 + PGBOUNCER_IGNORE_STARTUP_PARAMETERS: extra_float_digits + PGBOUNCER_APPLICATION_NAME_ADD_HOST: "1" ports: - "6432:6432" - volumes: - - ./pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini:ro # 确保 postgres 完全启动后再启动 pgbouncer depends_on: postgres: