-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (30 loc) · 1.5 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
ARG PG_VERSION=17
FROM postgres:${PG_VERSION} AS builder
ARG PG_VERSION
RUN apt update && \
apt install -y wget unzip build-essential python3-venv postgresql-server-dev-${PG_VERSION} postgresql-plpython3-${PG_VERSION}
RUN python3 -m venv /opt/venv
ENV PATH "/opt/venv/bin:$PATH"
RUN pip3 install build pyyaml toml
COPY ./ /opt
WORKDIR /opt
RUN python3 package.py
WORKDIR /opt/build
RUN ./build.sh && ./post-install.sh
FROM postgres:${PG_VERSION}
ARG PG_VERSION
COPY --from=builder /opt/build/python/dist/lenticular_lens-1.0-py3-none-any.whl /app/
COPY --from=builder /opt/build/post-install.sh /app/
COPY --from=builder /usr/lib/postgresql/${PG_VERSION}/lib/lenticular_lens.so /usr/lib/postgresql/${PG_VERSION}/lib/
COPY --from=builder /usr/lib/postgresql/${PG_VERSION}/lib/bitcode/lenticular_lens/ /usr/lib/postgresql/${PG_VERSION}/lib/bitcode/lenticular_lens/
COPY --from=builder /usr/lib/postgresql/${PG_VERSION}/lib/bitcode/lenticular_lens* /usr/lib/postgresql/${PG_VERSION}/lib/bitcode/
COPY --from=builder /usr/share/postgresql/${PG_VERSION}/extension/lenticular_lens* /usr/share/postgresql/${PG_VERSION}/extension/
RUN apt update && \
apt install -y python3-venv postgresql-plpython3-${PG_VERSION}
RUN python3 -m venv /app/venv
ENV PATH "/app/venv/bin:$PATH"
RUN pip3 install /app/lenticular_lens-1.0-py3-none-any.whl && \
/app/post-install.sh
RUN rm /app/lenticular_lens-1.0-py3-none-any.whl && \
rm /app/post-install.sh
RUN echo listen_addresses='0.0.0.0' >> /usr/lib/tmpfiles.d/postgresql.conf