Skip to content

Commit

Permalink
Added dockerfile with postgres debug build (#233)
Browse files Browse the repository at this point in the history
* Added dockerfile with postgres debug build

* Use prepublished image of postgres debug

* Update comment

* Change dockerfile dev to use postgres debug image

* Update comment
  • Loading branch information
var77 authored Dec 6, 2023
1 parent 78f0ebd commit 37a8519
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
ARG VERSION=16
ARG VERSION=15
ARG PGVECTOR_VERSION=0.5.0
ARG IMAGE_TAG=$VERSION-bookworm

FROM postgres:$IMAGE_TAG
ARG VERSION
# If you want to build the base image for different versions
# Refer to the base image Dockerfile here https://github.com/var77/postgres-docker-debug
# To use GDB inside container run docker like this:
# docker build . -t lantern-dev
# docker run --cap-add=SYS_PTRACE -p 5433:5432 -d --name lantern-dev lantern-dev
# Then exec to it docker exec -ti lantern-dev bash
# sudo su
# gdb -p $pid_of_pg_backend

FROM varik77/postgres:$VERSION-debug
ARG PGVECTOR_VERSION

WORKDIR /lantern

RUN apt update \
# Fix the locales package version to prevent unexpected updates
&& apt-mark hold locales \
&& apt install -y --no-install-recommends \
build-essential \
cmake \
postgresql-server-dev-$VERSION \
gdb \
wget \
python3-pip \
python3-dev \
sudo \
curl \
git-all \
tmux \
clang-format \
&& pip install GitPython libtmux --break-system-packages && \
USER root
ENV DEBIAN_FRONTEND=noninteractive
RUN pip install GitPython libtmux && \
wget -O pgvector.tar.gz https://github.com/pgvector/pgvector/archive/refs/tags/v${PGVECTOR_VERSION}.tar.gz && \
tar xzf pgvector.tar.gz && \
cd pgvector-${PGVECTOR_VERSION} && \
Expand All @@ -43,7 +36,9 @@ RUN rm -rf build \
RUN mkdir build/lantern \
&& git clone https://github.com/lanterndata/benchmark build/benchmark \
&& cd build/benchmark \
&& pip install -r core/requirements.txt --break-system-packages \
&& pip install -r external/requirements.txt --break-system-packages
ENV DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres
ENV LANTERN_DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres
&& pip install -r core/requirements.txt \
&& pip install -r external/requirements.txt
ENV DATABASE_URL=postgres://postgres@localhost:5432/postgres
ENV LANTERN_DATABASE_URL=postgres://postgres@localhost:5432/postgres

USER postgres

0 comments on commit 37a8519

Please sign in to comment.