File tree Expand file tree Collapse file tree 1 file changed +41
-9
lines changed Expand file tree Collapse file tree 1 file changed +41
-9
lines changed Original file line number Diff line number Diff line change 1
- # syntax=docker/dockerfile:1.4
1
+ # https://github.com/supabase/pg_jsonschema/blob/master/dockerfiles/db/Dockerfile
2
+ FROM postgres:16 as base
3
+ RUN apt-get update
2
4
3
- FROM alpine:3.19 AS downloader
4
- RUN apk add --no-cache git
5
- RUN git clone https://github.com/supabase/pg_jsonschema.git
6
- WORKDIR /pg_jsonschema
7
- RUN ln -s dockerfiles/db/Dockerfile Dockerfile.pg_jsonschema
5
+ ENV build_deps ca-certificates \
6
+ git \
7
+ build-essential \
8
+ libpq-dev \
9
+ postgresql-server-dev-16 \
10
+ curl \
11
+ libreadline6-dev \
12
+ zlib1g-dev
8
13
9
- FROM scratch AS pg_jsonschema
10
- COPY --from=downloader /pg_jsonschema /
11
14
12
- FROM pg_jsonschema AS base
15
+ RUN apt-get install -y --no-install-recommends $build_deps pkg-config cmake
16
+
17
+ WORKDIR /home/supa
18
+
19
+ ENV HOME=/home/supa \
20
+ PATH=/home/supa/.cargo/bin:$PATH
21
+ RUN chown postgres:postgres /home/supa
22
+ USER postgres
23
+
24
+ RUN \
25
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal --default-toolchain stable && \
26
+ rustup --version && \
27
+ rustc --version && \
28
+ cargo --version
29
+
30
+ # PGX
31
+ RUN cargo install cargo-pgrx --version 0.12.6 --locked
32
+
33
+ RUN cargo pgrx init --pg16 $(which pg_config)
34
+
35
+ USER root
36
+
37
+ COPY . .
38
+ RUN cargo pgrx install
39
+
40
+ RUN chown -R postgres:postgres /home/supa
41
+ RUN chown -R postgres:postgres /usr/share/postgresql/16/extension
42
+ RUN chown -R postgres:postgres /usr/lib/postgresql/16/lib
43
+
44
+ USER postgres
13
45
14
46
# Script to detect whether the database has finished initializing
15
47
COPY ["true_isready.sh" , "/usr/local/bin/" ]
You can’t perform that action at this time.
0 commit comments