ARG ALPINE_VERSION=3.13.6 ARG BASE_IMAGE=sutty/monit FROM ${BASE_IMAGE}:${ALPINE_VERSION} MAINTAINER "f " ARG PG_VERSION=13 ARG PG_VERSION_APPENDED ENV PGVER=$PG_VERSION ENV PGBASE=/var/lib/postgresql ENV PGDATA=${PGBASE}/${PGVER}/data ENV PAGER="less -niSFX" # Starting from Alpine 3.15 there are several PostgreSQL versions # supported. RUN apk add --no-cache postgresql${PG_VERSION_APPENDED} postgresql${PG_VERSION_APPENDED}-contrib daemonize less RUN install -dm 750 -o postgres -g postgres /etc/postgres.d COPY ./monit.conf /etc/monit.d/postgresql.conf COPY ./postgresqld.sh /usr/local/bin/postgresqld COPY ./postgresql.conf /etc/postgres.d/postgresql.conf EXPOSE 5432 VOLUME $PGBASE