1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-12 10:45:38 +02:00
Mailu/webmails/roundcube/Dockerfile

62 lines
2.3 KiB
Docker
Raw Normal View History

# NOTE: only add file if building for arm
2019-08-30 16:24:08 +02:00
ARG ARCH=""
ARG QEMU=other
2020-11-21 01:55:38 +02:00
FROM ${ARCH}php:7.4-apache as build_arm
2021-08-03 13:58:54 +02:00
ONBUILD COPY --from=balenalib/rpi-alpine:3.14 /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
2020-11-21 01:55:38 +02:00
FROM ${ARCH}php:7.4-apache as build_other
FROM build_${QEMU}
#Shared layer between rainloop and roundcube
RUN apt-get update && apt-get install -y \
2021-11-02 16:32:27 +02:00
python3 curl python3-pip git python3-multidict tzdata \
&& rm -rf /var/lib/apt/lists \
2021-09-28 12:29:57 +02:00
&& echo "ServerSignature Off\nServerName roundcube" >> /etc/apache2/apache2.conf \
&& sed -i 's,CustomLog.*combined$,\0 "'"expr=!(%{HTTP_USER_AGENT}=='health'\&\&(-R '127.0.0.1/8' || -R '::1'))"'",' /etc/apache2/sites-available/000-default.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.4.11/roundcubemail-1.4.11-complete.tar.gz
ENV CARDDAV_URL https://github.com/mstilkerich/rcmcarddav/releases/download/v4.1.2/carddav-v4.1.2.tar.gz
2019-12-26 21:29:45 +02:00
2021-11-02 16:32:27 +02:00
ENV TZ Etc/UTC
2018-10-11 03:18:35 +02:00
RUN apt-get update && apt-get install -y \
2020-03-07 20:38:12 +02:00
zlib1g-dev libzip4 libzip-dev libpq-dev \
python3-jinja2 \
gpg \
2020-03-06 16:55:35 +02:00
&& docker-php-ext-install zip pdo_mysql pdo_pgsql \
2021-11-02 16:32:27 +02:00
&& echo date.timezone=${TZ} > /usr/local/etc/php/conf.d/timezone.ini \
2018-10-11 03:18:35 +02:00
&& rm -rf /var/www/html/ \
&& cd /var/www \
&& curl -sL ${ROUNDCUBE_URL} | tar xz \
&& curl -sL ${CARDDAV_URL} | tar xz \
&& mv roundcubemail-* html \
2019-12-26 21:29:45 +02:00
&& mv carddav html/plugins/ \
&& cd html \
&& rm -rf CHANGELOG INSTALL LICENSE README.md UPGRADING composer.json-dist installer composer.* \
&& 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 \
&& ln -sf index.php /var/www/html/sso.php \
2021-09-28 11:16:40 +02:00
&& ln -sf /dev/stderr /var/www/html/logs/errors.log \
&& chown -R root:root . \
2021-09-28 11:16:40 +02:00
&& chown www-data:www-data logs temp \
&& chmod -R a+rX . \
2021-09-06 13:48:13 +02:00
&& rm -rf /var/lib/apt/lists \
&& a2enmod rewrite deflate expires headers
2018-12-07 13:37:40 +02:00
COPY php.ini /php.ini
COPY config.inc.php /var/www/html/config/
2021-02-06 19:14:58 +02:00
COPY mailu.php /var/www/html/plugins/mailu/mailu.php
2018-10-23 10:58:36 +02:00
COPY start.py /start.py
EXPOSE 80/tcp
VOLUME ["/data"]
2018-10-23 10:58:36 +02:00
CMD /start.py
2018-10-16 21:38:12 +02:00
2021-09-28 11:06:59 +02:00
HEALTHCHECK CMD curl -f -L -H 'User-Agent: health' http://localhost/ || exit 1