From 6b161e500ccf0e3f375f175fdc8c3db5e20aeb7d Mon Sep 17 00:00:00 2001 From: Ryan Voots Date: Sun, 31 Dec 2023 13:07:56 -0500 Subject: [PATCH] Working with both extensions now --- Dockerfile | 3 ++- docker-compose.yml | 12 ++++++++++++ docker-entrypoint-initdb.d/002-install-pgvector.sh | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile index 3176208..dab5bef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,11 +22,12 @@ RUN git clone --branch $PGVECTOR_REF --depth 1 https://github.com/pgvector/pgvec WORKDIR /tmp/pgvector/ RUN make && make install -COPY docker-entrypoint-initdb.d/* /docker-entrypoint-initdb.d/ COPY --from=timebuild /go/bin/* /usr/local/bin/ RUN git clone --branch $TS_REF https://github.com/timescale/timescaledb /tmp/timescaledb WORKDIR /tmp/timescaledb RUN ./bootstrap -DCMAKE_BUILD_TYPE=RelWithDebInfo -DREGRESS_CHECKS=OFF -DTAP_CHECKS=OFF -DGENERATE_DOWNGRADE_SCRIPT=ON -DWARNINGS_AS_ERRORS=OFF -DPROJECT_INSTALL_METHOD="docker" RUN cd build && make && make install +RUN sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'timescaledb,\2'/;s/,'/'/" /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample +COPY docker-entrypoint-initdb.d/* /docker-entrypoint-initdb.d/ WORKDIR / diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..bfdf690 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3.1' + +services: + + db: + build: . + restart: unless-stopped + environment: + POSTGRES_PASSWORD: pass + POSTGRES_USER: user + POSTGRES_DB: aimach + diff --git a/docker-entrypoint-initdb.d/002-install-pgvector.sh b/docker-entrypoint-initdb.d/002-install-pgvector.sh index 491999b..45dfdef 100644 --- a/docker-entrypoint-initdb.d/002-install-pgvector.sh +++ b/docker-entrypoint-initdb.d/002-install-pgvector.sh @@ -22,7 +22,7 @@ if [ -z "${POSTGRESQL_CONF_DIR:-}" ]; then fi cat <${create_sql} -CREATE EXTENSION IF NOT EXISTS pgvector CASCADE; +CREATE EXTENSION IF NOT EXISTS vector CASCADE; EOF if [ -z "${POSTGRESQL_PASSWORD:-}" ]; then