当前位置:   article > 正文

docker-compose创建pgsql数据库

pgvector docker compose

创建PG普通数据库

  1. version: "3.3"
  2. services:
  3. postgres:
  4. image: postgres:12-alpine
  5. container_name: postgres
  6. restart: always
  7. environment:
  8. POSTGRES_USER: root
  9. POSTGRES_PASSWORD: 123456
  10. ports:
  11. - 5432:5432
  12. volumes:
  13. - ./data:/var/lib/postgresql/data

 自己构建向量数据库

  1. FROM postgres:12-alpine
  2. RUN apk add --no-cache --virtual .build-deps \
  3. build-base \
  4. git \
  5. && git clone https://gitee.com/openhubble/pgvector.git /usr/src/pgvector \
  6. && cd /usr/src/pgvector \
  7. && make \
  8. && make install \
  9. && cd / \
  10. && rm -rf /usr/src/pgvector \
  11. && apk del .build-deps
  12. RUN echo "shared_preload_libraries = 'pgvector'" >> /usr/local/share/postgresql/postgresql.conf.sample

直接构建PG向量数据库

  1. version: "3.3"
  2. services:
  3. postgres:
  4. image: ankane/pgvector
  5. #image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.4.2
  6. container_name: postgres
  7. restart: always
  8. environment:
  9. POSTGRES_USER: root
  10. POSTGRES_PASSWORD: 123456
  11. ports:
  12. - 5432:5432
  13. volumes:
  14. - ./data:/var/lib/postgresql/data

 pg向量数据库参考资料:能否在postgres:15.3-alpine镜像上添加pgvector扩展? (volcengine.com)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/581209
推荐阅读
相关标签
  

闽ICP备14008679号