From 6b0daebc12e46c1d3f34f34ee2ecec1d6276a9f1 Mon Sep 17 00:00:00 2001 From: Gaspard Wierzbinski Date: Sun, 7 Apr 2024 01:11:43 -1000 Subject: [PATCH] Update Dockerfile --- Dockerfile | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 08a8491..4f7a57c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,12 @@ -# Use the latest Postgres Docker image based on Alpine FROM postgres:16-alpine -# Set working directory -WORKDIR /usr/src/app +RUN apk update && apk add git build-base postgresql-dev +RUN postgres --version +RUN git clone https://github.com/fboulnois/pg_uuidv7 +RUN cd pg_uuidv7 && make && make install && ls -la -# Install curl -RUN apk add --no-cache curl +COPY ./init.sql /docker-entrypoint-initdb.d/init.sql -RUN cd "$(mktemp -d)" \ - && curl -LO "https://github.com/fboulnois/pg_uuidv7/releases/download/v1.3.0/{pg_uuidv7.tar.gz,SHA256SUMS}" \ - && tar xf pg_uuidv7.tar.gz \ - && sha256sum -c SHA256SUMS \ - && PG_MAJOR=$(pg_config --version | sed 's/^.* \([0-9]\{1,\}\).*$/\1/') \ - && cp "$PG_MAJOR/pg_uuidv7.so" "$(pg_config --pkglibdir)" \ - && cp sql/pg_uuidv7--1.3.sql pg_uuidv7.control "$(pg_config --sharedir)/extension" # Add a script to run the CREATE EXTENSION command RUN printf '#!/bin/sh\npsql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE EXTENSION pg_uuidv7;"' > /docker-entrypoint-initdb.d/init.sh