Skip to content

Commit 59b7e44

Browse files
authored
Update Dockerfile
1 parent e1d9d80 commit 59b7e44

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

Dockerfile

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#https://github.com/supabase/pg_jsonschema/blob/master/dockerfiles/db/Dockerfile
2-
FROM postgres:16 as base
2+
FROM alpine:3.19 AS downloader
3+
RUN apk add --no-cache git
4+
RUN git clone https://github.com/supabase/pg_jsonschema.git --depth 1
5+
6+
FROM postgres:16
37
RUN apt-get update
48

59
ENV build_deps ca-certificates \
@@ -15,10 +19,10 @@ ENV build_deps ca-certificates \
1519
RUN apt-get install -y --no-install-recommends $build_deps pkg-config cmake
1620

1721
WORKDIR /home/supa
18-
22+
COPY --from=downloader /pg_jsonschema ./
1923
ENV HOME=/home/supa \
2024
PATH=/home/supa/.cargo/bin:$PATH
21-
RUN chown postgres:postgres /home/supa
25+
RUN chown postgres:postgres /home/supa -R
2226
USER postgres
2327

2428
RUN \
@@ -42,16 +46,3 @@ RUN chown -R postgres:postgres /usr/share/postgresql/16/extension
4246
RUN chown -R postgres:postgres /usr/lib/postgresql/16/lib
4347

4448
USER postgres
45-
46-
# Script to detect whether the database has finished initializing
47-
COPY ["true_isready.sh", "/usr/local/bin/"]
48-
COPY ["database scripts/00_dump.sql", "database scripts/0[2345]_*.sql", "database scripts/json_schema_extension.sql", "/docker-entrypoint-initdb.d/"]
49-
50-
# Install https://github.com/gavinwahl/postgres-json-schema/
51-
# extension that allows validation of jsonb fields against jsonschema
52-
COPY ["install_postgres_json_schema_extension.sh", "install_postgres_json_schema_extension.sh"]
53-
RUN chmod u+x install_postgres_json_schema_extension.sh
54-
RUN ./install_postgres_json_schema_extension.sh
55-
56-
FROM base AS demo
57-
COPY ["database scripts/demo_db.sql", "/docker-entrypoint-initdb.d/"]

0 commit comments

Comments
 (0)