build(postgres): 添加 pgvector 栈配置

This commit is contained in:
cnphpbb
2026-09-20 22:48:21 +08:00
parent 86b5f1b7b1
commit c8bf3fcf7f
3 changed files with 25 additions and 0 deletions
+2
View File
@@ -20,7 +20,9 @@ IMAGE_TAG_V17=postgres:17.10
IMAGE_TAG_V18=postgres:18.6 IMAGE_TAG_V18=postgres:18.6
IMAGE_TAG_PGVECTOR_PG18=pgvector/pgvector:pg18-trixie
POSTGRES_USER=postgres
POSTGRES_PASSWORD=<your-strong-password> POSTGRES_PASSWORD=<your-strong-password>
POSTGRES_HOST_AUTH_METHOD=scram-sha-256 POSTGRES_HOST_AUTH_METHOD=scram-sha-256
+22
View File
@@ -0,0 +1,22 @@
services:
pgvector:
image: ${IMAGE_TAG_PGVECTOR_PG18}
container_name: dbs_pgvector
restart: unless-stopped
command: ["postgres", "-c", "max_connections=200"]
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD}
- POSTGRES_INITDB_ARGS=--auth-host=${POSTGRES_HOST_AUTH_METHOD}
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- ${Volumes_Path}/pgdata:/var/lib/postgresql/data
healthcheck:
test:
- CMD-SHELL
- pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-postgres}
interval: 10s
timeout: 5s
retries: 10
+1
View File
@@ -17,6 +17,7 @@ services:
# >=17 版本,数据目录为 /var/lib/postgresql # >=17 版本,数据目录为 /var/lib/postgresql
# <=16 版本,数据目录为 /var/lib/postgresql/data # <=16 版本,数据目录为 /var/lib/postgresql/data
- /data/volumes/postgres/data:/var/lib/postgresql - /data/volumes/postgres/data:/var/lib/postgresql
# 时区配置
- /etc/timezone:/etc/timezone:ro - /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
ports: ports: