forked from erp-dev/erp
giveup4
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -8,11 +8,13 @@ services:
|
|||||||
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
||||||
POSTGRES_DB: ${POSTGRES_DB:-flower}
|
POSTGRES_DB: ${POSTGRES_DB:-flower}
|
||||||
# 仅绑定到本机,避免把数据库暴露到公网
|
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:${POSTGRES_PORT:-5432}:5432"
|
- "5432:5432"
|
||||||
volumes:
|
volumes:
|
||||||
- db_data:/var/lib/postgresql/data
|
- db_data:/var/lib/postgresql/data
|
||||||
|
dns:
|
||||||
|
- 8.8.8.8
|
||||||
|
- 8.8.4.4
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
@@ -25,14 +27,6 @@ services:
|
|||||||
image: pgbouncer/pgbouncer:latest
|
image: pgbouncer/pgbouncer:latest
|
||||||
container_name: pgbouncer
|
container_name: pgbouncer
|
||||||
# 配置文件已包含所有配置,环境变量仅作为备用
|
# 配置文件已包含所有配置,环境变量仅作为备用
|
||||||
environment:
|
|
||||||
DATABASES_HOST: postgres
|
|
||||||
DATABASES_PORT: "${POSTGRES_PORT:-5432}"
|
|
||||||
DATABASES_USER: ${POSTGRES_USER:-postgres}
|
|
||||||
DATABASES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
|
||||||
DATABASES_DBNAME: ${POSTGRES_DB:-flower}
|
|
||||||
ports:
|
|
||||||
- "${PGBOUNCER_PORT:-6432}:6432"
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini
|
- ./pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini
|
||||||
# 确保 postgres 完全启动后再启动 pgbouncer
|
# 确保 postgres 完全启动后再启动 pgbouncer
|
||||||
@@ -41,9 +35,8 @@ services:
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
# DNS 配置:使用 Docker 内置 DNS,并添加 DNS 搜索域
|
# DNS 配置:使用 Docker 内置 DNS,并添加 DNS 搜索域
|
||||||
dns:
|
dns:
|
||||||
- 127.0.0.11 # Docker 内置 DNS
|
- 8.8.8.8
|
||||||
dns_search:
|
- 8.8.4.4
|
||||||
- . # 当前网络域
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
|
|||||||
Reference in New Issue
Block a user