diff --git a/docker-compose-deps.yml b/docker-compose-deps.yml index e9f8035a7..b074f14b4 100644 --- a/docker-compose-deps.yml +++ b/docker-compose-deps.yml @@ -3,7 +3,9 @@ services: # Actual Speckle Server dependencies postgres: - image: 'postgres:14.5-alpine' + build: + context: . + dockerfile: docker/postgres/Dockerfile restart: always environment: POSTGRES_DB: speckle diff --git a/docker/postgres/Dockerfile b/docker/postgres/Dockerfile new file mode 100644 index 000000000..9da6a4538 --- /dev/null +++ b/docker/postgres/Dockerfile @@ -0,0 +1,25 @@ +FROM postgres:14.5-alpine as builder + +RUN apk add --no-cache 'git=~2.36' \ + 'build-base=~0.5' \ + 'clang=~13.0' \ + 'llvm13=~13.0' + +WORKDIR / +RUN git clone --branch 1.1.9 https://github.com/aiven/aiven-extras.git aiven-extras + +WORKDIR /aiven-extras +RUN git checkout 36598ab \ + && git clean -df \ + && make \ + && make install + +FROM postgres:14.5-alpine + +COPY --from=builder /aiven-extras/aiven_extras.control /usr/local/share/postgresql/extension/aiven_extras.control +COPY --from=builder /aiven-extras/sql/aiven_extras.sql /usr/local/share/postgresql/extension/aiven_extras--1.1.9.sql +COPY --from=builder /aiven-extras/aiven_extras.so /usr/local/lib/postgresql/aiven_extras.so + +EXPOSE 5432 + +CMD ["postgres"]