forked from erp-dev/erp
rollback
This commit is contained in:
@@ -12,58 +12,6 @@ services:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- db_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
restart: unless-stopped
|
||||
|
||||
pgbouncer:
|
||||
image: pgbouncer/pgbouncer:latest
|
||||
container_name: pgbouncer
|
||||
# 使用环境变量配置,让镜像自动生成配置文件
|
||||
environment:
|
||||
# 数据库连接配置 - 使用 DATABASES 环境变量(格式:数据库名=host=主机 port=端口 dbname=数据库名 user=用户 password=密码)
|
||||
# 确保密码与 PostgreSQL 容器的 POSTGRES_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
|
||||
# 使用 trust 认证时,需要指定 auth_user,所有客户端连接都使用此用户
|
||||
PGBOUNCER_AUTH_USER: postgres
|
||||
# 连接池配置
|
||||
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"
|
||||
# 确保 postgres 完全启动后再启动 pgbouncer
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
# DNS 配置:使用 Docker 内置 DNS,并添加 DNS 搜索域
|
||||
dns:
|
||||
- 127.0.0.11 # Docker 内置 DNS
|
||||
dns_search:
|
||||
- . # 当前网络域
|
||||
restart: unless-stopped
|
||||
|
||||
pgadmin:
|
||||
@@ -120,13 +68,12 @@ services:
|
||||
PYTHONPATH: /app
|
||||
DEBUG: "1"
|
||||
ALLOWED_HOSTS: "localhost,127.0.0.1,0.0.0.0,8.148.215.233,yuwenerp.yuwen.cloud"
|
||||
DB_HOST: pgbouncer
|
||||
DB_PORT: "6432"
|
||||
DB_HOST: postgres
|
||||
DB_PORT: "5432"
|
||||
DB_NAME: flower
|
||||
DB_USER: postgres
|
||||
DB_PASSWORD: postgres
|
||||
depends_on:
|
||||
- pgbouncer
|
||||
- postgres
|
||||
- redis
|
||||
- rabbitmq
|
||||
@@ -148,20 +95,19 @@ services:
|
||||
- --pool=solo
|
||||
volumes:
|
||||
- .:/app
|
||||
depends_on:
|
||||
- postgres
|
||||
- redis
|
||||
- rabbitmq
|
||||
environment:
|
||||
CELERY_BROKER_URL: amqp://guest:guest@rabbitmq:5672//
|
||||
CELERY_RESULT_BACKEND: redis://redis:6379/0
|
||||
PYTHONPATH: /app
|
||||
DB_HOST: pgbouncer
|
||||
DB_PORT: "6432"
|
||||
DB_HOST: postgres
|
||||
DB_PORT: "5432"
|
||||
DB_NAME: flower
|
||||
DB_USER: postgres
|
||||
DB_PASSWORD: postgres
|
||||
depends_on:
|
||||
- pgbouncer
|
||||
- postgres
|
||||
- redis
|
||||
- rabbitmq
|
||||
restart: unless-stopped
|
||||
|
||||
celery_beat:
|
||||
@@ -178,21 +124,20 @@ services:
|
||||
- info
|
||||
volumes:
|
||||
- .:/app
|
||||
depends_on:
|
||||
- postgres
|
||||
- redis
|
||||
- rabbitmq
|
||||
environment:
|
||||
DJANGO_SETTINGS_MODULE: flower.settings
|
||||
PYTHONPATH: /app
|
||||
DB_HOST: pgbouncer
|
||||
DB_PORT: "6432"
|
||||
DB_HOST: postgres
|
||||
DB_PORT: "5432"
|
||||
DB_NAME: flower
|
||||
DB_USER: postgres
|
||||
DB_PASSWORD: postgres
|
||||
CELERY_BROKER_URL: amqp://guest:guest@rabbitmq:5672//
|
||||
CELERY_RESULT_BACKEND: redis://redis:6379/0
|
||||
depends_on:
|
||||
- pgbouncer
|
||||
- postgres
|
||||
- redis
|
||||
- rabbitmq
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
|
||||
Reference in New Issue
Block a user