forked from timescale/pgai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
69 lines (62 loc) · 1.93 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# syntax=docker/dockerfile:1.3-labs
ARG PG_MAJOR
FROM postgres:${PG_MAJOR}
ENV WHERE_AM_I=docker
ENV DEBIAN_FRONTEND=noninteractive
USER root
RUN set -e; \
apt-get update; \
apt-get upgrade -y; \
apt-get install -y --no-install-recommends \
postgresql-plpython3-${PG_MAJOR} \
postgresql-${PG_MAJOR}-pgvector \
postgresql-${PG_MAJOR}-pgextwlist \
postgresql-server-dev-${PG_MAJOR} \
python3-pip \
build-essential \
pkg-config \
make \
cmake \
clang \
git \
curl \
vim
# install timescaledb
RUN set -e; \
mkdir -p /build/timescaledb; \
git clone https://github.com/timescale/timescaledb.git --branch 2.17.1 /build/timescaledb; \
cd /build/timescaledb; \
bash ./bootstrap; \
cd build && make; \
make install; \
rm -rf /build/timescaledb
# install pgvectorscale
ARG RUSTFLAGS
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN set -e; \
rustup install stable; \
cargo install cargo-pgrx --version 0.12.5 --locked; \
cargo pgrx init --pg${PG_MAJOR} pg_config; \
mkdir -p /build/pgvectorscale; \
git clone --branch 0.4.0 https://github.com/timescale/pgvectorscale /build/pgvectorscale; \
cd /build/pgvectorscale/pgvectorscale; \
if [ -n "$RUSTFLAGS" ]; then \
export RUSTFLAGS=${RUSTFLAGS}; \
fi; \
cargo pgrx install --release --features pg${PG_MAJOR}; \
rm -rf /build/pgvectorscale
# install pgspot
ENV PIP_BREAK_SYSTEM_PACKAGES=1
RUN set -eux; \
git clone https://github.com/timescale/pgspot.git /build/pgspot; \
pip install /build/pgspot; \
rm -rf /build/pgspot
# install our dev/test python dependencies
ENV PIP_BREAK_SYSTEM_PACKAGES=1
COPY requirements-test.txt /build/requirements-test.txt
RUN pip install -r /build/requirements-test.txt
COPY projects/pgai/requirements.txt /build/requirements-pgai.txt
RUN pip install -r /build/requirements-pgai.txt
RUN rm -r /build
WORKDIR /pgai