chore: use pgvector for postgres image instead of building

This commit is contained in:
khorshuheng 2024-09-30 16:20:19 +08:00
parent 757d0e5380
commit d99f85cffd
5 changed files with 3 additions and 51 deletions

View File

@ -28,9 +28,7 @@ services:
postgres:
restart: on-failure
build:
context: ./postgres
dockerfile: postgres.Dockerfile
image: pgvector/pgvector:pg16
ports:
- "5432:5432"
environment:

View File

@ -21,9 +21,7 @@ services:
postgres:
restart: on-failure
build:
context: ./postgres
dockerfile: postgres.Dockerfile
image: pgvector/pgvector:pg16
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_DB=${POSTGRES_DB:-postgres}

View File

@ -26,9 +26,7 @@ services:
postgres:
restart: on-failure
build:
context: ./postgres
dockerfile: postgres.Dockerfile
image: pgvector/pgvector:pg16
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_DB=${POSTGRES_DB:-postgres}

View File

@ -1,27 +0,0 @@
FROM postgres:latest
# Install dependencies required for pgjwt and locales
RUN apt-get update && \
apt-get install --fix-missing -y \
build-essential \
postgresql-server-dev-all \
git \
locales && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Setup locale
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen en_US.UTF-8 && \
update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Clone and build pgjwt
RUN rm -rf pgjwt && \
git clone https://github.com/michelp/pgjwt.git && \
cd pgjwt && \
make && \
make install

View File

@ -1,15 +0,0 @@
# This is installing the pgvector extension for postgres
FROM postgres:latest
RUN apt-get update && apt-get install -y \
build-essential \
git \
postgresql-server-dev-all \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
RUN git clone https://github.com/pgvector/pgvector.git
WORKDIR /tmp/pgvector
RUN make
RUN make install