diff --git a/core/dovecot/Dockerfile b/core/dovecot/Dockerfile index 72753e1e..a377ef90 100644 --- a/core/dovecot/Dockerfile +++ b/core/dovecot/Dockerfile @@ -1,4 +1,13 @@ +<<<<<<< HEAD # syntax=docker/dockerfile-upstream:1.4.3 +======= +ARG DISTRO=alpine:3.10 +FROM $DISTRO +# python3 shared with most images +RUN apk add --no-cache \ + python3 py3-pip git bash py3-multidict \ + && pip3 install --upgrade pip +>>>>>>> 09ee3ce9 (Install py3-multidict from repository before installing socrate to avoid the need of gcc during build) # dovecot image FROM base diff --git a/core/nginx/Dockerfile b/core/nginx/Dockerfile index cacb6c99..4d37fc44 100644 --- a/core/nginx/Dockerfile +++ b/core/nginx/Dockerfile @@ -1,4 +1,13 @@ +<<<<<<< HEAD # syntax=docker/dockerfile-upstream:1.4.3 +======= +ARG DISTRO=alpine:3.10 +FROM $DISTRO +# python3 shared with most images +RUN apk add --no-cache \ + python3 py3-pip git bash py3-multidict \ + && pip3 install --upgrade pip +>>>>>>> 09ee3ce9 (Install py3-multidict from repository before installing socrate to avoid the need of gcc during build) # build static assets (intermediate) FROM base as static diff --git a/core/postfix/Dockerfile b/core/postfix/Dockerfile index 578294df..d90a60d5 100644 --- a/core/postfix/Dockerfile +++ b/core/postfix/Dockerfile @@ -1,4 +1,13 @@ +<<<<<<< HEAD # syntax=docker/dockerfile-upstream:1.4.3 +======= +ARG DISTRO=alpine:3.10 +FROM $DISTRO +# python3 shared with most images +RUN apk add --no-cache \ + python3 py3-pip git bash py3-multidict \ + && pip3 install --upgrade pip +>>>>>>> 09ee3ce9 (Install py3-multidict from repository before installing socrate to avoid the need of gcc during build) # postfix image FROM base diff --git a/core/rspamd/Dockerfile b/core/rspamd/Dockerfile index 9f61f7d0..579a1bdc 100644 --- a/core/rspamd/Dockerfile +++ b/core/rspamd/Dockerfile @@ -1,4 +1,13 @@ +<<<<<<< HEAD # syntax=docker/dockerfile-upstream:1.4.3 +======= +ARG DISTRO=alpine:3.10 +FROM $DISTRO +# python3 shared with most images +RUN apk add --no-cache \ + python3 py3-pip git bash py3-multidict \ + && pip3 install --upgrade pip +>>>>>>> 09ee3ce9 (Install py3-multidict from repository before installing socrate to avoid the need of gcc during build) # rspamd image FROM base diff --git a/optional/postgresql/Dockerfile b/optional/postgresql/Dockerfile new file mode 100644 index 00000000..fbcad249 --- /dev/null +++ b/optional/postgresql/Dockerfile @@ -0,0 +1,36 @@ +ARG DISTRO=alpine:3.10 +FROM $DISTRO +# python3 shared with most images +RUN apk add --no-cache \ + python3 py3-pip bash py3-multidict \ + && pip3 install --upgrade pip + +# Shared layer between nginx, dovecot, postfix, postgresql, rspamd, unbound, rainloop, roundcube +RUN pip3 install socrate + +# Image specific layers under this line +RUN apk add --no-cache \ + postgresql postgresql-libs busybox-suid sudo tar \ + && apk add --virtual .build-deps gcc musl-dev postgresql-dev python3-dev \ + && pip3 install psycopg2 anosql==0.3.1 \ + && apk --purge del .build-deps + +COPY start.py /start.py +COPY basebackup.sh /basebackup.sh +COPY conf /conf + +COPY postgres_crontab /etc/postgres_crontab +RUN crontab /etc/postgres_crontab + +ENV LANG en_US.UTF-8 + +RUN mkdir -p /data /backup /run/postgresql \ + && chown -R postgres:postgres /run/postgresql \ + && chmod 2777 /run/postgresql + +VOLUME /data +VOLUME /backup +EXPOSE 5432 + +CMD /start.py +HEALTHCHECK CMD psql -h 127.0.0.1 -d postgres -U health -c "select 1 as ok;" || exit 1 diff --git a/optional/unbound/Dockerfile b/optional/unbound/Dockerfile index 95c63707..4f8cf43e 100644 --- a/optional/unbound/Dockerfile +++ b/optional/unbound/Dockerfile @@ -1,4 +1,13 @@ +<<<<<<< HEAD # syntax=docker/dockerfile-upstream:1.4.3 +======= +ARG DISTRO=alpine:3.10 +FROM $DISTRO +# python3 shared with most images +RUN apk add --no-cache \ + python3 py3-pip git bash py3-multidict \ + && pip3 install --upgrade pip +>>>>>>> 09ee3ce9 (Install py3-multidict from repository before installing socrate to avoid the need of gcc during build) # resolver image FROM base diff --git a/webmails/rainloop/Dockerfile b/webmails/rainloop/Dockerfile new file mode 100644 index 00000000..1674da1d --- /dev/null +++ b/webmails/rainloop/Dockerfile @@ -0,0 +1,50 @@ +ARG ARCH="" +ARG QEMU=other + +# NOTE: only add file if building for arm +FROM ${ARCH}php:7.3-apache as build_arm +ONBUILD COPY --from=balenalib/rpi-alpine:3.10 /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static + +FROM ${ARCH}php:7.3-apache as build_other + +FROM build_${QEMU} +#Shared layer between rainloop and roundcube +RUN apt-get update && apt-get install -y \ + python3 curl python3-pip git python3-multidict \ + && rm -rf /var/lib/apt/lists \ + && echo "ServerSignature Off" >> /etc/apache2/apache2.conf + +# Shared layer between nginx, dovecot, postfix, postgresql, rspamd, unbound, rainloop, roundcube +RUN pip3 install socrate + +ENV RAINLOOP_URL https://github.com/RainLoop/rainloop-webmail/releases/download/v1.13.0/rainloop-community-1.13.0.zip + +RUN apt-get update && apt-get install -y \ + unzip python3-jinja2 \ + && rm -rf /var/www/html/ \ + && mkdir /var/www/html \ + && cd /var/www/html \ + && curl -L -O ${RAINLOOP_URL} \ + && unzip -q *.zip \ + && rm -f *.zip \ + && rm -rf data/ \ + && find . -type d -exec chmod 755 {} \; \ + && find . -type f -exec chmod 644 {} \; \ + && chown -R www-data: * \ + && apt-get purge -y unzip \ + && rm -rf /var/lib/apt/lists + +COPY include.php /var/www/html/include.php +COPY php.ini /php.ini + +COPY application.ini /application.ini +COPY default.ini /default.ini + +COPY start.py /start.py + +EXPOSE 80/tcp +VOLUME ["/data"] + +CMD /start.py + +HEALTHCHECK CMD curl -f -L http://localhost/ || exit 1 diff --git a/webmails/roundcube/Dockerfile b/webmails/roundcube/Dockerfile new file mode 100644 index 00000000..5e5cfe0f --- /dev/null +++ b/webmails/roundcube/Dockerfile @@ -0,0 +1,49 @@ +# NOTE: only add file if building for arm +ARG ARCH="" +ARG QEMU=other +FROM ${ARCH}php:7.3-apache as build_arm +ONBUILD COPY --from=balenalib/rpi-alpine:3.10 /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static + +FROM ${ARCH}php:7.3-apache as build_other + +FROM build_${QEMU} +#Shared layer between rainloop and roundcube +RUN apt-get update && apt-get install -y \ + python3 curl python3-pip git python3-multidict \ + && rm -rf /var/lib/apt/lists \ + && echo "ServerSignature Off" >> /etc/apache2/apache2.conf + +# Shared layer between nginx, dovecot, postfix, postgresql, rspamd, unbound, rainloop, roundcube +RUN pip3 install socrate + +ENV ROUNDCUBE_URL https://github.com/roundcube/roundcubemail/releases/download/1.3.10/roundcubemail-1.3.10-complete.tar.gz + +RUN apt-get update && apt-get install -y \ + zlib1g-dev libzip4 libzip-dev \ + python3-jinja2 \ + && docker-php-ext-install zip \ + && echo date.timezone=UTC > /usr/local/etc/php/conf.d/timezone.ini \ + && rm -rf /var/www/html/ \ + && cd /var/www \ + && curl -L -O ${ROUNDCUBE_URL} \ + && tar -xf *.tar.gz \ + && rm -f *.tar.gz \ + && mv roundcubemail-* html \ + && cd html \ + && rm -rf CHANGELOG INSTALL LICENSE README.md UPGRADING composer.json-dist installer \ + && sed -i 's,mod_php5.c,mod_php7.c,g' .htaccess \ + && sed -i 's,^php_value.*post_max_size,#&,g' .htaccess \ + && sed -i 's,^php_value.*upload_max_filesize,#&,g' .htaccess \ + && chown -R www-data: logs temp \ + && rm -rf /var/lib/apt/lists + +COPY php.ini /php.ini +COPY config.inc.php /var/www/html/config/ +COPY start.py /start.py + +EXPOSE 80/tcp +VOLUME ["/data"] + +CMD /start.py + +HEALTHCHECK CMD curl -f -L http://localhost/ || exit 1