Skip to content

Instantly share code, notes, and snippets.

@K-Mistele
Last active January 16, 2025 18:36
Show Gist options
  • Save K-Mistele/34ca819d9d2df12acbb6ce2f0ebc5dd7 to your computer and use it in GitHub Desktop.
Save K-Mistele/34ca819d9d2df12acbb6ce2f0ebc5dd7 to your computer and use it in GitHub Desktop.
Dockerfile for pgvector (postgres 16) + vectorscale by Timescale DB. Only what you need, no other timescale stuff.
FROM pgvector/pgvector:pg16
# install prerequisites
## rust
RUN apt-get update
RUN apt-get install -y build-essential curl git jq make gcc pkg-config clang postgresql-server-dev-16 libssl-dev
RUN apt-get update
# Get Rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
SHELL ["/bin/bash", "-l", "-c"]
#download, build and install pgvectorscale
WORKDIR /opt
RUN git clone https://github.com/timescale/pgvectorscale
WORKDIR /opt/pgvectorscale/pgvectorscale
## cargo-pgrx with the same version as pgrx
RUN bash -c "cargo install --locked cargo-pgrx --version $(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "pgrx") | .version') && \
cargo pgrx init --pg16 pg_config && \
cargo pgrx install --release"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment