Skip to content

Commit f2fe5ca

Browse files
committed
update dockerfile to proper user and other requirements for cloudnative-pg
1 parent 082f08d commit f2fe5ca

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

docker/pgvector-postgis/Dockerfile

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
ARG BASE=postgres
22
ARG BASE_VERSION=14
3+
ARG BARMAN_VERSION=3.14.0
34
FROM ${BASE}:${BASE_VERSION}
45

56
LABEL org.opencontainers.image.source="https://github.com/launchql/launchql"
67
ARG BASE
78
ARG BASE_VERSION
9+
ARG BARMAN_VERSION
810
ENV BASE_VERSION=${BASE_VERSION}
11+
ENV PIP_BREAK_SYSTEM_PACKAGES=1
912

1013
# Debian-based: install both pgvector and postgis from PGDG per-PG-major
14+
# Plus CloudNativePG requirements: pgaudit, pg-failover-slots, barman-cloud
1115
RUN set -eux; \
1216
export DEBIAN_FRONTEND=noninteractive; \
1317
apt-get update; \
@@ -24,7 +28,22 @@ RUN set -eux; \
2428
postgresql-${PG_MAJOR}-postgis-3-scripts \
2529
postgis \
2630
postgresql-${PG_MAJOR}-pgvector \
31+
postgresql-${PG_MAJOR}-pgaudit \
32+
postgresql-${PG_MAJOR}-pg-failover-slots \
33+
locales-all \
34+
build-essential \
35+
python3-dev \
36+
python3-pip \
37+
python3-psycopg2 \
38+
python3-setuptools \
2739
make \
2840
bash; \
29-
rm -rf /var/lib/apt/lists/*
41+
pip3 install --no-cache-dir barman[cloud,azure,snappy,google,zstandard,lz4]==${BARMAN_VERSION}; \
42+
apt-get remove -y --purge --autoremove build-essential python3-dev; \
43+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
44+
rm -rf /var/lib/apt/lists/* /var/cache/* /var/log/*
3045

46+
# Change postgres user to UID 26 for CloudNativePG compatibility
47+
RUN usermod -u 26 postgres
48+
49+
USER 26

0 commit comments

Comments
 (0)