perf(install): don't build the WebUI image twice on a fresh install

startPreInstall called installLibrePortalImageWebUI standalone AND then
installLibrePortalAppWebUI, whose app-install step 1 builds the same image
again — so a fresh install built libreportal-service twice back-to-back
(2nd mostly Docker-cache hits, but a redundant copyFolder + "this may take a
while" block). The standalone call only matters on a rebuild where the
app-install path SKIPS (libreportal already in the DB). Gate it on exactly
that: build standalone only when libreportal is already installed. Net: one
build in both cases (fresh → via app install; reinstall → standalone).

Signed-off-by: librelad <librelad@digitalangels.vip>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
librelad 2026-07-06 21:44:16 +01:00
parent 53497a662f
commit c0382dfa4f

View File

@ -47,7 +47,13 @@ startPreInstall()
installSSLCertificate; installSSLCertificate;
installSwapfile; installSwapfile;
installLibrePortalImageWebUI; # installLibrePortalAppWebUI builds the WebUI image as its step 1 on a fresh
# install (libreportal not yet in the DB). Only build standalone here when
# that path will be SKIPPED (libreportal already installed — a rebuild), so a
# fresh install doesn't build the same image twice.
if [[ "$(dockerCheckAppInstalled libreportal docker)" != "not_installed" ]]; then
installLibrePortalImageWebUI;
fi
installLibrePortalAppWebUI; installLibrePortalAppWebUI;
installLibrePortalWebUITaskService; installLibrePortalWebUITaskService;