Skip to content

Update Dockerfile #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,47 @@
FROM postgres:13-alpine AS base
#https://github.com/supabase/pg_jsonschema/blob/master/dockerfiles/db/Dockerfile
FROM postgres:16 as base
RUN apt-get update

ENV build_deps ca-certificates \
git \
build-essential \
libpq-dev \
postgresql-server-dev-16 \
curl \
libreadline6-dev \
zlib1g-dev


RUN apt-get install -y --no-install-recommends $build_deps pkg-config cmake

Check notice

Code scanning / SonarCloud

Arguments in long RUN instructions should be sorted Low

Sort these package names alphanumerically. See more on SonarQube Cloud

WORKDIR /home/supa

ENV HOME=/home/supa \
PATH=/home/supa/.cargo/bin:$PATH
RUN chown postgres:postgres /home/supa
USER postgres

RUN \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal --default-toolchain stable && \
rustup --version && \
rustc --version && \
cargo --version

# PGX
RUN cargo install cargo-pgrx --version 0.12.6 --locked

RUN cargo pgrx init --pg16 $(which pg_config)

USER root

COPY . .
RUN cargo pgrx install

RUN chown -R postgres:postgres /home/supa
RUN chown -R postgres:postgres /usr/share/postgresql/16/extension
RUN chown -R postgres:postgres /usr/lib/postgresql/16/lib

USER postgres

# Script to detect whether the database has finished initializing
COPY ["true_isready.sh", "/usr/local/bin/"]
Expand Down
Loading