diff --git a/Dockerfile b/Dockerfile index 64eda945e3a0a4aca97d5493e80129b05c07872f..33db6b7636eef27933461f7c06d31a260b42e32b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,34 @@ FROM nextcloud:19.0.8-fpm +ARG BASE_DIR="/usr/src/nextcloud" +ARG THEME_VERSION="19.0.8.2" +ARG NEWS_VERSION="14.2.2" + RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images COPY patches/ /tmp/build_patches/ -RUN sed -i 's/19,0,8,1/19,0,8,2/g' /usr/src/nextcloud/version.php -#RUN patch -u /usr/src/nextcloud/core/signature.json -i /tmp/build_patches/001-sha512-signature.patch -RUN patch -u /usr/src/nextcloud/core/Controller/LoginController.php -i /tmp/build_patches/002-login-without-domain.patch -RUN patch -u /usr/src/nextcloud/core/templates/layout.user.php -i /tmp/build_patches/003-contact-search-removal.patch -RUN patch -u /usr/src/nextcloud/core/Controller/ContactsMenuController.php -i /tmp/build_patches/004-contact-search-controller-removal.patch \ No newline at end of file +COPY custom_entrypoint.sh / +RUN chmod +x /custom_entrypoint.sh +RUN sed -i 's/19,0,8,1/19,0,8,3/' ${BASE_DIR}/version.php + +# Patches +#RUN patch -u ${BASE_DIR}/core/signature.json -i /tmp/build_patches/001-sha512-signature.patch +RUN patch -u ${BASE_DIR}/core/Controller/LoginController.php -i /tmp/build_patches/002-login-without-domain.patch +RUN patch -u ${BASE_DIR}/core/templates/layout.user.php -i /tmp/build_patches/003-contact-search-removal.patch +RUN patch -u ${BASE_DIR}/core/Controller/ContactsMenuController.php -i /tmp/build_patches/004-contact-search-controller-removal.patch +RUN rm -rf /tmp/build_patches/ + +# Custom apps +RUN curl -fsSL -o news.tar.gz \ + "https://github.com/nextcloud/news/releases/download/${NEWS_VERSION}/news.tar.gz" && \ + tar -xf news.tar.gz -C ${BASE_DIR}/custom_apps/ && \ + rm news.tar.gz; + +# Custom theme +RUN curl -fsSL -o eelo-theme.tar.gz \ + "https://gitlab.e.foundation/e/infra/nextcloud-theme/-/archive/${THEME_VERSION}/nextcloud-theme-${THEME_VERSION}.tar.gz" && \ + tar -xf eelo-theme.tar.gz -C /tmp/ && \ + mv /tmp/nextcloud-theme-${THEME_VERSION}/eelo ${BASE_DIR}/themes/ && \ + chown -R www-data:www-data ${BASE_DIR}/themes/eelo/ && \ + rm -rf eelo-theme.tar.gz /tmp/nextcloud-theme-* ${BASE_DIR}/themes/example/ + +ENTRYPOINT ["/custom_entrypoint.sh"] +CMD ["php-fpm"] \ No newline at end of file diff --git a/custom_entrypoint.sh b/custom_entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..cf055cd980aa3a73ad5d204e983504bd7adb3a28 --- /dev/null +++ b/custom_entrypoint.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +echo "Custom eCloud entrypoint" +rsync_options="-rlDog --chown www-data:www-data --delete" + +rsync $rsync_options --include "/news/" --exclude '/*' /usr/src/nextcloud/custom_apps/ /var/www/html/custom_apps/ +rsync $rsync_options --include "/eelo/" --exclude '/*' /usr/src/nextcloud/themes/ /var/www/html/themes/ + +/entrypoint.sh "$@" +echo "bye bye NC" \ No newline at end of file