fix composer no longer installs EGroupware apps (runs plugins) as root and npm install fails silent on network errors / timeouts

This commit is contained in:
ralf 2024-04-30 13:14:41 +02:00
parent b1bb97c256
commit 191bdc39e6

View File

@ -77,7 +77,7 @@ exit $RESULT' \
&& cd /usr/share \ && cd /usr/share \
# not all dependencies already allow PHP 8.x, thought what we use from them works # not all dependencies already allow PHP 8.x, thought what we use from them works
&& bash -c "[[ $PHP_VERSION =~ ^8\..* ]]" && COMPOSER_EXTRA=--ignore-platform-reqs || true \ && bash -c "[[ $PHP_VERSION =~ ^8\..* ]]" && COMPOSER_EXTRA=--ignore-platform-reqs || true \
&& composer.phar create-project $COMPOSER_EXTRA --prefer-dist --no-scripts --no-dev egroupware/egroupware:$VERSION \ && COMPOSER_ALLOW_SUPERUSER=1 composer.phar create-project $COMPOSER_EXTRA --prefer-dist --no-scripts --no-dev egroupware/egroupware:$VERSION \
# clean up and remove caches # clean up and remove caches
&& composer.phar clear-cache \ && composer.phar clear-cache \
&& rm -f /usr/local/bin/composer.phar && rm -f /usr/local/bin/composer.phar
@ -95,10 +95,14 @@ RUN set -e \
&& apt-get update \ && apt-get update \
&& apt-get install -y nodejs libatomic1 ; \ && apt-get install -y nodejs libatomic1 ; \
fi \ fi \
&& npm config set fetch-retries 5 \
&& npm install -g grunt-cli \ && npm install -g grunt-cli \
# npm install fails "silent" on network timeouts, retry until it works
&& until grunt; do sleep 5; npm install -g grunt-cli; done \
&& mkdir chunks \
&& npm install \ && npm install \
&& grunt \ # npm install fails "silent" on network timeouts, retry until it works
&& mkdir chunks && npm run build \ && until npm run build; do sleep 5; npm install; done \
# clean up and remove caches # clean up and remove caches
&& npm uninstall -g grunt-cli \ && npm uninstall -g grunt-cli \
&& npm cache clear --force \ && npm cache clear --force \