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

70 lines
2.8 KiB
Docker
Raw Normal View History

# NOTE: only add qemu-arm-static if building for arm
2019-08-30 16:24:08 +02:00
ARG ARCH=""
ARG QEMU=other
FROM ${ARCH}php:8.0-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
FROM ${ARCH}php:8.0-apache as build_other
FROM build_${QEMU}
RUN set -eu \
&& apt update \
&& echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
&& apt install -y --no-install-recommends \
python3 curl python3-pip git python3-multidict \
python3-jinja2 gpg tzdata \
&& pip3 install socrate \
&& echo date.timezone=UTC > /usr/local/etc/php/conf.d/timezone.ini \
&& 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 \
\
&& mark="$(apt-mark showmanual)" \
&& apt install -y --no-install-recommends \
libfreetype6-dev libicu-dev libjpeg62-turbo-dev libldap2-dev libmagickwand-dev \
libpng-dev libpq-dev libsqlite3-dev libzip-dev libpspell-dev libonig-dev \
&& ln -s php.ini-production /usr/local/etc/php/php.ini \
&& docker-php-ext-configure gd --with-jpeg --with-freetype \
&& docker-php-ext-install exif gd intl zip pspell pdo_mysql pdo_pgsql pdo_sqlite \
&& pecl install imagick \
&& docker-php-ext-enable imagick opcache \
&& apt-mark auto '.*' >/dev/null \
&& apt-mark manual ${mark} >/dev/null \
&& ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so | awk '/=>/ { print $3 }' | sort -u | \
xargs -r dpkg-query -S | cut -d: -f1 | sort -u | xargs -r apt-mark manual >/dev/null \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists
ENV ROUNDCUBE_URL https://github.com/roundcube/roundcubemail/releases/download/1.5.0/roundcubemail-1.5.0-complete.tar.gz
ENV CARDDAV_URL https://github.com/mstilkerich/rcmcarddav/releases/download/v4.2.2/carddav-v4.2.2.tar.gz
2019-12-26 21:29:45 +02:00
RUN set -eu \
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.md SECURITY.md INSTALL LICENSE README.md UPGRADING composer.json-dist installer composer.* \
&& 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 . \
&& 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