From c8bf3fcf7fb23f1e4cd4e771256127a63ee039da Mon Sep 17 00:00:00 2001 From: cnphpbb Date: Sun, 20 Sep 2026 22:48:21 +0800 Subject: [PATCH] =?UTF-8?q?build(postgres):=20=E6=B7=BB=E5=8A=A0=20pgvecto?= =?UTF-8?q?r=20=E6=A0=88=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbSer/postgres/env.cfg.example | 2 ++ dbSer/postgres/pgvector.stack.yml | 22 ++++++++++++++++++++++ dbSer/postgres/prod.stack.yml | 1 + 3 files changed, 25 insertions(+) create mode 100644 dbSer/postgres/pgvector.stack.yml diff --git a/dbSer/postgres/env.cfg.example b/dbSer/postgres/env.cfg.example index 4f23b83..4d1a8a0 100644 --- a/dbSer/postgres/env.cfg.example +++ b/dbSer/postgres/env.cfg.example @@ -20,7 +20,9 @@ IMAGE_TAG_V17=postgres:17.10 IMAGE_TAG_V18=postgres:18.6 +IMAGE_TAG_PGVECTOR_PG18=pgvector/pgvector:pg18-trixie +POSTGRES_USER=postgres POSTGRES_PASSWORD= POSTGRES_HOST_AUTH_METHOD=scram-sha-256 diff --git a/dbSer/postgres/pgvector.stack.yml b/dbSer/postgres/pgvector.stack.yml new file mode 100644 index 0000000..90841ef --- /dev/null +++ b/dbSer/postgres/pgvector.stack.yml @@ -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 diff --git a/dbSer/postgres/prod.stack.yml b/dbSer/postgres/prod.stack.yml index 887dbd4..a762f52 100644 --- a/dbSer/postgres/prod.stack.yml +++ b/dbSer/postgres/prod.stack.yml @@ -17,6 +17,7 @@ services: # >=17 版本,数据目录为 /var/lib/postgresql # <=16 版本,数据目录为 /var/lib/postgresql/data - /data/volumes/postgres/data:/var/lib/postgresql + # 时区配置 - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: