# Note: Debian Trixie = Debian 13 FROM postgres:17-trixie # Install pg_search from GitHub Releases RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends ca-certificates curl; \ arch="$(dpkg --print-architecture)"; \ case "$arch" in \ amd64) checksum="b4487ab98af4324095954b382f014906729c2b7f3acb480c90aa9c63e1cb3334" ;; \ arm64) checksum="7dd22a89ae52a6aef39511a9f5f0f3d85dabb771eaf2e0ee3d1f2ef63ce4c538" ;; \ *) echo "unsupported architecture: $arch" >&2; exit 1 ;; \ esac; \ curl -fsSL -o /tmp/pg_search.deb "https://github.com/paradedb/paradedb/releases/download/v0.26.7/postgresql-17-pg-search_0.26.7-1PARADEDB-trixie_${arch}.deb"; \ echo "${checksum} */tmp/pg_search.deb" | sha256sum --strict --check -; \ apt-get install -y --no-install-recommends /tmp/pg_search.deb; \ apt-get purge -y --auto-remove curl; \ rm /tmp/pg_search.deb; \ apt-get dist-clean # Install pgvector RUN set -eux; \ echo "deb [ signed-by=/usr/local/share/keyrings/postgres.gpg.asc ] https://apt-archive.postgresql.org/pub/repos/apt trixie-pgdg-archive main" > /etc/apt/sources.list.d/pgdg-archive.list; \ apt-get update; \ apt-get install -y --no-install-recommends postgresql-17-pgvector=0.8.6-1.pgdg13+1; \ apt-get dist-clean RUN set -eux; \ echo "shared_preload_libraries = 'pg_search'" >> /usr/share/postgresql/postgresql.conf.sample COPY ./bootstrap_official.sh /docker-entrypoint-initdb.d/10_bootstrap_paradedb.sh # The upstream `postgres` Docker image comes with its own `entrypoint.sh` script which # starts as `root` and then switches to the `postgres` user after running chown and chmod # on the PostgreSQL data directory. To maintain compatibility with the upstream image and # ensure that the `postgres` user has the correct permissions on the data directory, we let # the upstream `entrypoint.sh` script run as the entrypoint and don't specify a custom user.