Skip to content

Instantly share code, notes, and snippets.

@enoonan
Last active July 7, 2025 06:50
Show Gist options
  • Save enoonan/9fd2515fd404da5ec143a496ce49c8e6 to your computer and use it in GitHub Desktop.
Save enoonan/9fd2515fd404da5ec143a496ce49c8e6 to your computer and use it in GitHub Desktop.
pgvector Dockerfile which I'm using on Fly.io
FROM flyio/postgres-flex:17.2
# Install build dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
postgresql-server-dev-all
# Set the pgvector version
ARG PGVECTOR_VERSION=0.8.0
# Download and extract the pgvector release, build the extension, and install it
RUN curl -L -o pgvector.tar.gz "https://github.com/ankane/pgvector/archive/refs/tags/v${PGVECTOR_VERSION}.tar.gz" && \
tar -xzf pgvector.tar.gz && \
cd "pgvector-${PGVECTOR_VERSION}" && \
make && \
make install
# Clean up build dependencies and temporary files
RUN apt-get remove -y build-essential curl postgresql-server-dev-all && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /pgvector.tar.gz /pgvector-${PGVECTOR_VERSION}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment