2021-09-01 18:56:44 +02:00
|
|
|
ARG DISTRO=alpine:3.14.2
|
2019-08-21 12:24:30 -04:00
|
|
|
FROM $DISTRO
|
2018-11-18 18:35:13 +02:00
|
|
|
# python3 shared with most images
|
|
|
|
RUN apk add --no-cache \
|
2021-11-02 11:19:42 +01:00
|
|
|
python3 py3-pip bash py3-multidict tzdata \
|
2018-11-18 18:35:13 +02:00
|
|
|
&& pip3 install --upgrade pip
|
2019-07-25 10:33:57 +02:00
|
|
|
|
|
|
|
# Shared layer between nginx, dovecot, postfix, postgresql, rspamd, unbound, rainloop, roundcube
|
2020-06-15 17:32:56 +02:00
|
|
|
RUN pip3 install socrate==0.2.0
|
2019-07-25 10:33:57 +02:00
|
|
|
|
2018-11-18 18:35:13 +02:00
|
|
|
# Image specific layers under this line
|
|
|
|
RUN apk add --no-cache \
|
2018-12-10 15:01:27 +01:00
|
|
|
postgresql postgresql-libs busybox-suid sudo tar \
|
2018-11-18 18:35:13 +02:00
|
|
|
&& apk add --virtual .build-deps gcc musl-dev postgresql-dev python3-dev \
|
2019-01-07 12:55:59 +02:00
|
|
|
&& pip3 install psycopg2 anosql==0.3.1 \
|
2018-11-18 18:35:13 +02:00
|
|
|
&& apk --purge del .build-deps
|
|
|
|
|
|
|
|
COPY start.py /start.py
|
2018-11-28 18:41:31 +02:00
|
|
|
COPY basebackup.sh /basebackup.sh
|
2018-11-18 18:35:13 +02:00
|
|
|
COPY conf /conf
|
|
|
|
|
2018-11-28 18:41:31 +02:00
|
|
|
COPY postgres_crontab /etc/postgres_crontab
|
|
|
|
RUN crontab /etc/postgres_crontab
|
|
|
|
|
2018-11-18 18:35:13 +02:00
|
|
|
ENV LANG en_US.UTF-8
|
|
|
|
|
2018-11-22 07:46:57 +02:00
|
|
|
RUN mkdir -p /data /backup /run/postgresql \
|
|
|
|
&& chown -R postgres:postgres /run/postgresql \
|
2018-11-18 23:48:20 +02:00
|
|
|
&& chmod 2777 /run/postgresql
|
|
|
|
|
2018-11-21 12:30:35 +02:00
|
|
|
VOLUME /data
|
2018-11-22 07:46:57 +02:00
|
|
|
VOLUME /backup
|
2018-11-18 23:48:20 +02:00
|
|
|
EXPOSE 5432
|
2018-11-18 18:35:13 +02:00
|
|
|
|
|
|
|
CMD /start.py
|
2018-11-30 13:54:12 +02:00
|
|
|
HEALTHCHECK CMD psql -h 127.0.0.1 -d postgres -U health -c "select 1 as ok;" || exit 1
|