postgres/Dockerfile

16 lines
559 B
Docker
Raw Normal View History

2024-03-12 08:15:30 +01:00
FROM postgres:16-alpine
2024-04-07 13:11:43 +02:00
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
2024-03-12 08:15:30 +01:00
2024-04-07 13:11:43 +02:00
COPY ./init.sql /docker-entrypoint-initdb.d/init.sql
2024-03-12 08:15:30 +01:00
# 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
2024-03-12 08:15:30 +01:00
# Make the entrypoint script executable
RUN chmod +x /docker-entrypoint-initdb.d/init.sh
2024-03-12 09:05:56 +01:00
CMD ["postgres"]