From 68c163d9436fc5a73bf26ad437114800b0c66ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20I=C3=9Fbr=C3=BCcker?= Date: Sun, 7 Apr 2024 11:05:48 +0200 Subject: [PATCH] Fix HTML snapshot errors related to single-file-cli (#683) * Install node 20 on debian image * use singlefile fork --- docker/alpine.Dockerfile | 6 ++++-- docker/default.Dockerfile | 12 ++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docker/alpine.Dockerfile b/docker/alpine.Dockerfile index 1a613a2..d28b02a 100644 --- a/docker/alpine.Dockerfile +++ b/docker/alpine.Dockerfile @@ -99,7 +99,9 @@ CMD ["./bootstrap.sh"] FROM linkding AS linkding-plus -# install node, chromium and single-file -RUN apk update && apk add nodejs npm chromium && npm install -g single-file-cli +# install node, chromium +RUN apk update && apk add nodejs npm chromium +# install single-file from fork for now, which contains several hotfixes +RUN npm install -g https://github.com/sissbruecker/single-file-cli/tarball/f3730995a52f27d5041a1ad9e7528af4b6b4cf4b # enable snapshot support ENV LD_ENABLE_SNAPSHOTS=True diff --git a/docker/default.Dockerfile b/docker/default.Dockerfile index fe5fc6c..778448f 100644 --- a/docker/default.Dockerfile +++ b/docker/default.Dockerfile @@ -96,7 +96,15 @@ CMD curl -f http://localhost:${LD_SERVER_PORT:-9090}/${LD_CONTEXT_PATH}health || CMD ["./bootstrap.sh"] FROM linkding AS linkding-plus -# install node, chromium and single-file -RUN apt-get update && apt-get -y install nodejs npm chromium && npm install -g single-file-cli +# install chromium +RUN apt-get update && apt-get -y install chromium +# install node +ENV NODE_MAJOR=20 +RUN apt-get install -y gnupg2 apt-transport-https ca-certificates && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ + apt-get update && apt-get install -y nodejs +# install single-file from fork for now, which contains several hotfixes +RUN npm install -g https://github.com/sissbruecker/single-file-cli/tarball/f3730995a52f27d5041a1ad9e7528af4b6b4cf4b # enable snapshot support ENV LD_ENABLE_SNAPSHOTS=True