forked from DevOps/deploy.stack
fix(postgres): 显式指定 Volumes_Path 和 initdb 编码
- env.cfg.example 新增 Volumes_Path=/data/volumes/postgres
- prod.stack.yml 卷路径改用 ${Volumes_Path} 变量
- pgvector.stack.yml 补充部署命令注释并设置默认认证方式
- redis env.cfg.example 补充数据目录创建说明
This commit is contained in:
@@ -23,6 +23,9 @@ IMAGE_TAG_V18=postgres:18.6
|
||||
IMAGE_TAG_PGVECTOR_PG18=pgvector/pgvector:pg18-trixie
|
||||
|
||||
POSTGRES_USER=postgres
|
||||
|
||||
POSTGRES_PASSWORD=<your-strong-password>
|
||||
|
||||
POSTGRES_HOST_AUTH_METHOD=scram-sha-256
|
||||
|
||||
Volumes_Path=/data/volumes/postgres
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
# mkdir -pv /data/volumes/postgres/pgdata
|
||||
# pull:: docker compose --env-file ./dbSer/postgres/env.cfg -f ./dbSer/postgres/prod.stack.yml pull
|
||||
#run:: docker compose -p prod-dbs --env-file ./dbSer/postgres/env.cfg -f ./dbSer/postgres/prod.stack.yml up -d
|
||||
|
||||
|
||||
services:
|
||||
|
||||
pgvector:
|
||||
image: ${IMAGE_TAG_PGVECTOR_PG18}
|
||||
container_name: dbs_pgvector
|
||||
@@ -8,8 +14,8 @@ services:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD}
|
||||
- POSTGRES_INITDB_ARGS=--auth-host=${POSTGRES_HOST_AUTH_METHOD}
|
||||
- POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD:-scram-sha-256}
|
||||
- POSTGRES_INITDB_ARGS=--encoding=UTF8 --locale=C --auth-host=${POSTGRES_HOST_AUTH_METHOD:-scram-sha-256}
|
||||
- PGDATA=/var/lib/postgresql/data/pgdata
|
||||
volumes:
|
||||
- ${Volumes_Path}/pgdata:/var/lib/postgresql/data
|
||||
|
||||
@@ -16,7 +16,7 @@ services:
|
||||
volumes:
|
||||
# >=17 版本,数据目录为 /var/lib/postgresql
|
||||
# <=16 版本,数据目录为 /var/lib/postgresql/data
|
||||
- /data/volumes/postgres/data:/var/lib/postgresql
|
||||
- ${Volumes_Path}/data:/var/lib/postgresql
|
||||
# 时区配置
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
|
||||
Reference in New Issue
Block a user