Skip to content

Commit

Permalink
test: try to use custom Dockerfile for pgvector support
Browse files Browse the repository at this point in the history
  • Loading branch information
firtoz committed Mar 24, 2024
1 parent 76460a6 commit faf0d9d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docker-compose.yml
Expand Up @@ -27,10 +27,8 @@ services:

# postgres
postgres:
# mdillon/postgis is postgres + PostGIS (only). if you need additional
# extensions, it's probably time to create a purpose-built image with all
# necessary extensions. sorry, and thanks for adding support for them!
image: "postgis/postgis:14-3.3"
build:
context: docker/pgvector
container_name: "typeorm-postgres"
ports:
- "5432:5432"
Expand Down
1 change: 1 addition & 0 deletions docker/pgvector/01_init.sql
@@ -0,0 +1 @@
CREATE EXTENSION vector;
17 changes: 17 additions & 0 deletions docker/pgvector/Dockerfile
@@ -0,0 +1,17 @@
# Start from the PostGIS image
# mdillon/postgis is postgres + PostGIS (only). if you need additional
# extensions, it's probably time to create a purpose-built image with all
# necessary extensions. sorry, and thanks for adding support for them!
FROM postgis/postgis:14-3.3

# Install git
RUN apt-get update && apt-get install -y git make gcc postgresql-server-dev-all

# Clone the pgvector repository
RUN git clone --branch v0.6.2 https://github.com/pgvector/pgvector.git

COPY 01_init.sql /docker-entrypoint-initdb.d/

# Build and install the pgvector extension
WORKDIR /pgvector
RUN make && make install

0 comments on commit faf0d9d

Please sign in to comment.