创建PG普通数据库
- version: "3.3"
- services:
- postgres:
- image: postgres:12-alpine
- container_name: postgres
- restart: always
- environment:
- POSTGRES_USER: root
- POSTGRES_PASSWORD: 123456
- ports:
- - 5432:5432
- volumes:
- - ./data:/var/lib/postgresql/data
自己构建向量数据库
- FROM postgres:12-alpine
-
- RUN apk add --no-cache --virtual .build-deps \
- build-base \
- git \
- && git clone https://gitee.com/openhubble/pgvector.git /usr/src/pgvector \
- && cd /usr/src/pgvector \
- && make \
- && make install \
- && cd / \
- && rm -rf /usr/src/pgvector \
- && apk del .build-deps
-
- RUN echo "shared_preload_libraries = 'pgvector'" >> /usr/local/share/postgresql/postgresql.conf.sample
直接构建PG向量数据库
- version: "3.3"
- services:
- postgres:
- image: ankane/pgvector
- #image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.4.2
- container_name: postgres
- restart: always
- environment:
- POSTGRES_USER: root
- POSTGRES_PASSWORD: 123456
- ports:
- - 5432:5432
- volumes:
- - ./data:/var/lib/postgresql/data
pg向量数据库参考资料:能否在postgres:15.3-alpine镜像上添加pgvector扩展? (volcengine.com)