1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-01-30 04:30:49 +02:00

37 lines
1.0 KiB
Docker
Raw Normal View History

2021-09-01 18:56:44 +02:00
ARG DISTRO=alpine:3.14.2
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
# 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
2018-11-18 18:35:13 +02:00
# Image specific layers under this line
RUN apk add --no-cache \
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
COPY basebackup.sh /basebackup.sh
2018-11-18 18:35:13 +02:00
COPY conf /conf
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
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