diff --git a/docker/roundcube/Dockerfile b/docker/roundcube/Dockerfile index 92cf23e6..e794f935 100644 --- a/docker/roundcube/Dockerfile +++ b/docker/roundcube/Dockerfile @@ -1,96 +1,105 @@ FROM almalinux:9 MAINTAINER Christian Mollekopf ENV HOME=/opt/app-root/src LABEL io.k8s.description="Platform for serving PHP roundcube applications" \ io.k8s.display-name="Roundcube" \ io.openshift.expose-services="80:http" \ io.openshift.tags="builder,php,apache" RUN dnf -y update # Add EPEL. RUN dnf -y install 'dnf-command(config-manager)' && \ dnf config-manager --set-enabled crb && \ dnf -y install epel-release && \ dnf -y install epel-next-release && \ dnf clean all # Add the EPEL key. RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-9 # Add kolab RUN rpm --import https://mirror.apheleia-it.ch/repos/Kolab:/16/key.asc && \ rpm -Uvh https://mirror.apheleia-it.ch/repos/Kolab:/16/kolab-16-for-el9.rpm # Install php modules RUN sed -i -e '/^ssl/d' /etc/yum.repos.d/kolab*.repo && \ dnf config-manager --enable kolab-16 &&\ dnf -y --setopt tsflags= install php-kolab php-kolabformat &&\ dnf clean all RUN dnf -y install \ composer \ diffutils \ file \ git \ make \ unzip \ curl-minimal \ mariadb \ which \ rsync \ openssl-devel \ httpd \ patch \ php-cli \ php-common \ php-devel \ php-ldap \ php-opcache \ php-pecl-apcu \ php-mysqlnd \ php-gd \ php-fpm \ php-pear \ # ImageMagick \ re2c \ npm \ wget && \ dnf -y install procps-ng iputils bind-utils sudo telnet mc && \ dnf clean all RUN dnf -y install --disablerepo epel-next ImageMagick RUN npm install -g less less-plugin-clean-css WORKDIR ${HOME} COPY /rootfs / + +ARG GIT_REF_ROUNDCUBEMAIL=dev/kolab-1.5 +ARG GIT_REF_ROUNDCUBEMAIL_PLUGINS=master +ARG GIT_REF_CHWALA=master +ARG GIT_REF_SYNCROTON=master +ARG GIT_REF_AUTOCONF=master +ARG GIT_REF_IRONY=master +ARG GIT_REF_FREEBUSY=master + RUN /opt/app-root/src/build.sh VOLUME /data RUN chgrp -R 0 /opt/app-root/src && \ chmod -R g=u /opt/app-root/src RUN mkdir -p /run/php-fpm && \ chmod 777 /run/php-fpm && \ mkdir -p /run/httpd && \ chmod 777 /run/httpd && \ mkdir -p /data && \ chmod 777 /data && \ chmod -R 777 /etc/httpd /var/log/httpd /var/lib/httpd /data RUN chown -R 1001:0 /opt/app-root/src /data USER 1001 EXPOSE 8080 # https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop STOPSIGNAL SIGWINCH CMD [ "/opt/app-root/src/init.sh" ] diff --git a/docker/roundcube/rootfs/opt/app-root/src/build.sh b/docker/roundcube/rootfs/opt/app-root/src/build.sh index 34dc3203..bd6d73b5 100755 --- a/docker/roundcube/rootfs/opt/app-root/src/build.sh +++ b/docker/roundcube/rootfs/opt/app-root/src/build.sh @@ -1,56 +1,56 @@ #!/bin/bash set -e set -x pushd /opt/app-root/src/ # Clone what we don't find (roundcubemail-skin-elastic is not publicly available, so can't be included this way) if [ ! -d roundcubemail ]; then - git clone --branch dev/kolab-1.5 https://git.kolab.org/source/roundcubemail.git roundcubemail + git clone --branch $GIT_REF_ROUNDCUBEMAIL https://git.kolab.org/source/roundcubemail.git roundcubemail fi if [ ! -d roundcubemail-plugins-kolab ]; then - git clone --branch master https://git.kolab.org/diffusion/RPK/roundcubemail-plugins-kolab.git roundcubemail-plugins-kolab + git clone --branch $GIT_REF_ROUNDCUBEMAIL_PLUGINS https://git.kolab.org/diffusion/RPK/roundcubemail-plugins-kolab.git roundcubemail-plugins-kolab fi if [ ! -d syncroton ]; then - git clone --branch master https://git.kolab.org/diffusion/S/syncroton.git syncroton + git clone --branch $GIT_REF_SYNCROTON https://git.kolab.org/diffusion/S/syncroton.git syncroton fi if [ ! -d iRony ]; then - git clone --branch master https://git.kolab.org/source/iRony.git iRony + git clone --branch $GIT_REF_IRONY https://git.kolab.org/source/iRony.git iRony fi if [ ! -d chwala ]; then - git clone --branch dev/kolabfiles https://git.kolab.org/diffusion/C/chwala.git chwala + git clone --branch $GIT_REF_CHWALA https://git.kolab.org/diffusion/C/chwala.git chwala fi if [ ! -d autoconf ]; then - git clone --branch master https://git.kolab.org/diffusion/AC/autoconf.git autoconf + git clone --branch $GIT_REF_AUTOCONF https://git.kolab.org/diffusion/AC/autoconf.git autoconf fi if [ ! -d freebusy ]; then - git clone --branch master https://git.kolab.org/diffusion/F/freebusy.git freebusy + git clone --branch $GIT_REF_FREEBUSY https://git.kolab.org/diffusion/F/freebusy.git freebusy fi pushd roundcubemail cp /opt/app-root/src/composer.json composer.json rm -rf vendor/ composer.lock php -dmemory_limit=-1 $(command -v composer) install cd /opt/app-root/src/ ./update.sh cd /opt/app-root/src/roundcubemail # Adjust the configs sed -i -r \ -e "s/'vlv'(\s+)=> false,/'vlv'\1=> true,/g" \ -e "s/'vlv_search'(\s+)=> false,/'vlv_search'\1=> true,/g" \ -e "s/inetOrgPerson/inetorgperson/g" \ -e "s/kolabInetOrgPerson/inetorgperson/g" \ config/*.inc.php sed -i -r -e "s|\$config\['managesieve_host'\] = .*$|\$config['managesieve_host'] = 'kolab';|g" config/managesieve.inc.php popd # Set the php timezone sed -i -r -e 's|^(;*)date\.timezone.*$|date.timezone = Europe/Zurich|g' /etc/php.ini # Allow environment variables from fpm sed -i -e "s/;clear_env/clear_env/" /etc/php-fpm.d/www.conf