Adding repmgr

This commit is contained in:
Torsten Raudssus 2023-05-07 03:46:33 +02:00
parent adced63dab
commit 3cd620c109
2 changed files with 17 additions and 13 deletions

View file

@ -36,3 +36,4 @@ docker-compose.override.yml
.git
root
examples

View file

@ -10,25 +10,28 @@ ENV SRV_VERSION $SRV_VERSION
ENV SRV_APT_GET_INSTALL $SRV_APT_GET_INSTALL
ENV DEBIAN_FRONTEND "noninteractive"
ENV PGDATA "/pgdata"
ENV PGDATA "/data"
# explicitly set user/group IDs
RUN if [ -z "$( getent group $SRV_GID )" ] ; then groupadd -r postgres --gid=$SRV_GID ; fi && \
useradd -r -g $SRV_GID --uid=$SRV_UID --home-dir=/var/lib/postgresql --shell=/bin/bash postgres && \
mkdir -p /pgdata && chown -R $SRV_UID:$SRV_GID /pgdata && \
mkdir -p $PGDATA && chown -R $SRV_UID:$SRV_GID $PGDATA && \
apt-get update -y && apt-get install -y lsb-release && \
( curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg ) && \
( echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list ) && \
apt-get update -y && mkdir -p /docker-entrypoint-initdb.d && \
apt-get install -y postgresql-15 postgresql-common postgresql-15-pglogical \
postgresql-15-cron postgresql-15-extra-window-functions postgresql-15-first-last-agg \
postgresql-15-jsquery postgresql-15-numeral postgresql-15-pglogical-ticker \
postgresql-15-pgmemcache postgresql-15-pgpcre postgresql-15-pgrouting \
postgresql-15-pgrouting-scripts postgresql-15-pgsphere postgresql-15-postgis-3 \
postgresql-15-postgis-3-scripts postgresql-15-repack postgresql-15-set-user \
postgresql-15-similarity postgresql-15-pgpool2 postgresql-15-semver \
postgresql-15-tablelog postgresql-15-wal2json $SRV_APT_GET_INSTALL && \
apt-get clean
postgresql-15-cron postgresql-15-extra-window-functions \
postgresql-15-first-last-agg postgresql-15-jsquery postgresql-15-numeral \
postgresql-15-pglogical-ticker postgresql-15-pgmemcache \
postgresql-15-pgpcre postgresql-15-pgrouting postgresql-15-repack \
postgresql-15-pgrouting-scripts postgresql-15-pgsphere \
postgresql-15-postgis-3 postgresql-15-postgis-3-scripts \
postgresql-15-repack postgresql-15-set-user postgresql-15-similarity \
postgresql-15-pgpool2 postgresql-15-semver postgresql-15-repmgr \
postgresql-15-tablelog postgresql-15-wal2json \
$SRV_APT_GET_INSTALL && \
apt-get clean && rm -rf /var/lib/apt/lists/*
ENV PATH="/usr/lib/postgresql/15/bin:$PATH"
@ -36,11 +39,11 @@ COPY docker-entrypoint.sh /usr/local/bin/
USER $SRV_UID:$SRV_GID
RUN ln -s /pgdata/.bash_history $HOME/.bash_history
RUN ln -s $PGDATA/.bash_history $HOME/.bash_history
VOLUME /pgdata
VOLUME $PGDATA
WORKDIR /pgdata
WORKDIR $PGDATA
ENTRYPOINT ["docker-entrypoint.sh"]