1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-04-23 12:08:54 +02:00

37 lines
998 B
Docker
Raw Normal View History

ARG DISTRO=alpine:3.10
FROM $DISTRO
2018-11-18 18:35:13 +02:00
# python3 shared with most images
RUN apk add --no-cache \
python3 py3-pip bash \
2018-11-18 18:35:13 +02:00
&& pip3 install --upgrade pip
# Shared layer between nginx, dovecot, postfix, postgresql, rspamd, unbound, rainloop, roundcube
RUN pip3 install socrate
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