diff --git a/Dockerfile b/Dockerfile index bff14b8..b529275 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,10 @@ -# Lean PostgreSQL image with pgvector, PostGIS, pg_textsearch, and pgsodium +# Lean PostgreSQL image with pgvector, PostGIS, and pg_textsearch # Multi-stage build - all toolchains discarded, only artifacts kept ARG PG_VERSION=17 ARG PGVECTOR_VERSION=0.8.0 ARG POSTGIS_VERSION=3.5.1 ARG PG_TEXTSEARCH_VERSION=0.6.0 -ARG PGSODIUM_VERSION=3.1.9 ############################################# # Stage 1: Build extensions @@ -15,7 +14,6 @@ FROM postgres:${PG_VERSION}-alpine AS builder ARG PGVECTOR_VERSION ARG POSTGIS_VERSION ARG PG_TEXTSEARCH_VERSION -ARG PGSODIUM_VERSION RUN apk add --no-cache \ git \ @@ -32,7 +30,6 @@ RUN apk add --no-cache \ protobuf-c-dev \ libxml2-dev \ pcre2-dev \ - libsodium-dev \ # PostGIS build tools perl \ flex \ @@ -62,12 +59,6 @@ RUN git clone --branch v${PG_TEXTSEARCH_VERSION} --depth 1 https://github.com/ti make -j$(nproc) && \ make install -# pgsodium -RUN git clone --branch v${PGSODIUM_VERSION} --depth 1 https://github.com/michelp/pgsodium.git && \ - cd pgsodium && \ - make -j$(nproc) && \ - make install - ############################################# # Stage 2: Final lean runtime image ############################################# @@ -81,12 +72,14 @@ RUN apk add --no-cache \ json-c \ protobuf-c \ libxml2 \ - pcre2 \ - libsodium + pcre2 # Copy compiled extensions from builder COPY --from=builder /usr/local/lib/postgresql/ /usr/local/lib/postgresql/ COPY --from=builder /usr/local/share/postgresql/ /usr/local/share/postgresql/ +# Preload pg_textsearch so CREATE EXTENSION works without manual config +RUN echo "shared_preload_libraries = 'pg_textsearch'" >> /usr/local/share/postgresql/postgresql.conf.sample + LABEL org.opencontainers.image.source="https://github.com/constructive-io/docker" -LABEL org.opencontainers.image.description="PostgreSQL 17 with pgvector, PostGIS, pg_textsearch, and pgsodium" +LABEL org.opencontainers.image.description="PostgreSQL 17 with pgvector, PostGIS, and pg_textsearch" diff --git a/README.md b/README.md index 91dd59c..4e3db68 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ Lean PostgreSQL 17 image with essential extensions for modern applications. | [pgvector](https://github.com/pgvector/pgvector) | Vector similarity search for embeddings | | [PostGIS](https://postgis.net/) | Spatial and geographic data | | [pg_textsearch](https://www.tigerdata.com/docs/use-timescale/latest/extensions/pg-textsearch) | BM25 full-text search | -| [pgsodium](https://github.com/michelp/pgsodium) | Encryption using libsodium | ## Usage @@ -35,7 +34,6 @@ Enable extensions as needed: CREATE EXTENSION vector; CREATE EXTENSION postgis; CREATE EXTENSION pg_textsearch; -CREATE EXTENSION pgsodium; ``` ## Build