Skip to content

Commit

Permalink
refactor: add PGVector for development image
Browse files Browse the repository at this point in the history
sixmen committed Nov 13, 2024
1 parent e1f17b7 commit 6d4b772
Showing 5 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ jobs:
ports:
- 21861:27017
postgres:
image: postgis/postgis:16-3.5
image: croquiscom/postgis-pgvector:16-3.5-0.7.3
env:
POSTGRES_DB: cormo_test
POSTGRES_USER: cormo_test
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ services:
- 21861:27017

postgres:
image: postgis/postgis:16-3.5
image: croquiscom/postgis-pgvector:16-3.5-0.7.3
environment:
POSTGRES_DB: cormo_test
POSTGRES_USER: cormo_test
1 change: 1 addition & 0 deletions tools/postgis-pgvector/20_pgvector.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE EXTENSION IF NOT EXISTS vector;
16 changes: 16 additions & 0 deletions tools/postgis-pgvector/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM postgis/postgis:16-3.5

RUN apt-get update \
&& apt-mark hold locales\
&& apt-get install -y --no-install-recommends git build-essential postgresql-server-dev-16 \
&& git clone --depth=1 --branch v0.7.3 https://github.com/pgvector/pgvector.git /tmp/pgvector \
&& cd /tmp/pgvector \
&& make clean && make OPTFLAGS="" && make install \
&& cd / \
&& rm -r /tmp/pgvector \
&& apt-get remove -y git build-essential postgresql-server-dev-16 \
&& apt-get autoremove -y \
&& apt-mark unhold locales \
&& rm -rf /var/lib/apt/lists/*

COPY 20_pgvector.sql /docker-entrypoint-initdb.d/20_pgvector.sql
4 changes: 4 additions & 0 deletions tools/postgis-pgvector/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

docker build --platform linux/amd64 -t croquiscom/postgis-pgvector:16-3.5-0.7.3 .
docker push croquiscom/postgis-pgvector:16-3.5-0.7.3

0 comments on commit 6d4b772

Please sign in to comment.