Skip to content

Commit b94168c

Browse files
committed
fix build issues
1 parent 929c8ed commit b94168c

2 files changed

Lines changed: 6 additions & 15 deletions

File tree

Dockerfile

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
# Lean PostgreSQL image with pgvector, PostGIS, pg_textsearch, and pgsodium
1+
# Lean PostgreSQL image with pgvector, PostGIS, and pg_textsearch
22
# Multi-stage build - all toolchains discarded, only artifacts kept
33

44
ARG PG_VERSION=17
55
ARG PGVECTOR_VERSION=0.8.0
66
ARG POSTGIS_VERSION=3.5.1
77
ARG PG_TEXTSEARCH_VERSION=0.6.0
8-
ARG PGSODIUM_VERSION=3.1.9
98

109
#############################################
1110
# Stage 1: Build extensions
@@ -15,7 +14,6 @@ FROM postgres:${PG_VERSION}-alpine AS builder
1514
ARG PGVECTOR_VERSION
1615
ARG POSTGIS_VERSION
1716
ARG PG_TEXTSEARCH_VERSION
18-
ARG PGSODIUM_VERSION
1917

2018
RUN apk add --no-cache \
2119
git \
@@ -32,7 +30,6 @@ RUN apk add --no-cache \
3230
protobuf-c-dev \
3331
libxml2-dev \
3432
pcre2-dev \
35-
libsodium-dev \
3633
# PostGIS build tools
3734
perl \
3835
flex \
@@ -62,12 +59,6 @@ RUN git clone --branch v${PG_TEXTSEARCH_VERSION} --depth 1 https://github.com/ti
6259
make -j$(nproc) && \
6360
make install
6461

65-
# pgsodium
66-
RUN git clone --branch v${PGSODIUM_VERSION} --depth 1 https://github.com/michelp/pgsodium.git && \
67-
cd pgsodium && \
68-
make -j$(nproc) && \
69-
make install
70-
7162
#############################################
7263
# Stage 2: Final lean runtime image
7364
#############################################
@@ -81,12 +72,14 @@ RUN apk add --no-cache \
8172
json-c \
8273
protobuf-c \
8374
libxml2 \
84-
pcre2 \
85-
libsodium
75+
pcre2
8676

8777
# Copy compiled extensions from builder
8878
COPY --from=builder /usr/local/lib/postgresql/ /usr/local/lib/postgresql/
8979
COPY --from=builder /usr/local/share/postgresql/ /usr/local/share/postgresql/
9080

81+
# Preload pg_textsearch so CREATE EXTENSION works without manual config
82+
RUN echo "shared_preload_libraries = 'pg_textsearch'" >> /usr/local/share/postgresql/postgresql.conf.sample
83+
9184
LABEL org.opencontainers.image.source="https://github.com/constructive-io/docker"
92-
LABEL org.opencontainers.image.description="PostgreSQL 17 with pgvector, PostGIS, pg_textsearch, and pgsodium"
85+
LABEL org.opencontainers.image.description="PostgreSQL 17 with pgvector, PostGIS, and pg_textsearch"

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Lean PostgreSQL 17 image with essential extensions for modern applications.
1313
| [pgvector](https://github.com/pgvector/pgvector) | Vector similarity search for embeddings |
1414
| [PostGIS](https://postgis.net/) | Spatial and geographic data |
1515
| [pg_textsearch](https://www.tigerdata.com/docs/use-timescale/latest/extensions/pg-textsearch) | BM25 full-text search |
16-
| [pgsodium](https://github.com/michelp/pgsodium) | Encryption using libsodium |
1716

1817
## Usage
1918

@@ -35,7 +34,6 @@ Enable extensions as needed:
3534
CREATE EXTENSION vector;
3635
CREATE EXTENSION postgis;
3736
CREATE EXTENSION pg_textsearch;
38-
CREATE EXTENSION pgsodium;
3937
```
4038

4139
## Build

0 commit comments

Comments
 (0)