1
0
forked from erp-dev/erp
This commit is contained in:
2025-12-24 23:18:07 +08:00
parent 3674ef72fa
commit 57b5a2b4d1
5 changed files with 42 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -12,6 +12,12 @@ services:
- "5432:5432" - "5432:5432"
volumes: volumes:
- db_data:/var/lib/postgresql/data - 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 restart: unless-stopped
pgbouncer: pgbouncer:
@@ -28,8 +34,15 @@ services:
- "6432:6432" - "6432:6432"
volumes: volumes:
- ./pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini - ./pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini
# 确保 postgres 完全启动后再启动 pgbouncer
depends_on: depends_on:
- postgres postgres:
condition: service_healthy
# DNS 配置:使用 Docker 内置 DNS并添加 DNS 搜索域
dns:
- 127.0.0.11 # Docker 内置 DNS
dns_search:
- . # 当前网络域
restart: unless-stopped restart: unless-stopped
pgadmin: pgadmin:

View File

@@ -13,6 +13,12 @@ services:
- "127.0.0.1:${POSTGRES_PORT:-5432}:5432" - "127.0.0.1:${POSTGRES_PORT:-5432}:5432"
volumes: volumes:
- db_data:/var/lib/postgresql/data - db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
restart: unless-stopped restart: unless-stopped
pgbouncer: pgbouncer:
@@ -29,8 +35,15 @@ services:
- "${PGBOUNCER_PORT:-6432}:6432" - "${PGBOUNCER_PORT:-6432}:6432"
volumes: volumes:
- ./pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini - ./pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini
# 确保 postgres 完全启动后再启动 pgbouncer
depends_on: depends_on:
- postgres postgres:
condition: service_healthy
# DNS 配置:使用 Docker 内置 DNS并添加 DNS 搜索域
dns:
- 127.0.0.11 # Docker 内置 DNS
dns_search:
- . # 当前网络域
restart: unless-stopped restart: unless-stopped
redis: redis:

View File

@@ -12,6 +12,12 @@ services:
- "5432:5432" - "5432:5432"
volumes: volumes:
- db_data:/var/lib/postgresql/data - 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 restart: unless-stopped
pgbouncer: pgbouncer:
@@ -29,8 +35,15 @@ services:
- "6432:6432" - "6432:6432"
volumes: volumes:
- ./pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini - ./pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini
# 确保 postgres 完全启动后再启动 pgbouncer
depends_on: depends_on:
- postgres postgres:
condition: service_healthy
# DNS 配置:使用 Docker 内置 DNS并添加 DNS 搜索域
dns:
- 127.0.0.11 # Docker 内置 DNS
dns_search:
- . # 当前网络域
restart: unless-stopped restart: unless-stopped
pgadmin: pgadmin: