From 4ed836ce677efdde909813f6f859f25591f6c993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 1 Nov 2023 16:49:26 +0100 Subject: [PATCH] Use (upgradable) node version 18 --- .dockerignore | 1 + .github/renovate.json5 | 6 ++++++ .nvmrc | 1 + Dockerfile | 11 ++++++----- 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 .nvmrc diff --git a/.dockerignore b/.dockerignore index 20f9aa4c..49bf72b5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,5 +7,6 @@ !cache !package.json !package-lock.json +!.nvmrc !pyproject.toml !poetry.lock diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 875168c0..9d8cc458 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -114,5 +114,11 @@ groupName: 'dpkg', automerge: true, }, + /** Only LTS version of Node */ + { + allowedVersions: '/(0|2|4|6|8)$/', + matchPackageNames: ['node'], + enabled: false, + }, ], } diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..3c032078 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +18 diff --git a/Dockerfile b/Dockerfile index c9cf884e..7d4cfcd8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,13 +29,14 @@ LABEL maintainer="info@camptocamp.com" SHELL ["/bin/bash", "-o", "pipefail", "-cux"] +COPY .nvmrc /tmp RUN --mount=type=cache,target=/var/lib/apt/lists,id=apt-list \ --mount=type=cache,target=/var/cache,id=var-cache,sharing=locked \ apt-get update \ && apt-get install --assume-yes --no-install-recommends apt-utils gnupg2 \ - && . /etc/os-release \ - && echo "deb https://deb.nodesource.com/node_14.x ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/nodesource.list \ - && curl --silent https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ + && NODE_MAJOR="$(cat /tmp/.nvmrc)" \ + && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \ + && curl --silent https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor --output=/etc/apt/keyrings/nodesource.gpg \ && apt-get update \ && echo 'Install packages from https://github.com/qgis/QGIS/blob//INSTALL.md \ Remove already in GDAL image: proj, GDAL and openjpeg ->: \ @@ -61,11 +62,11 @@ RUN --mount=type=cache,target=/var/lib/apt/lists,id=apt-list \ xfonts-scalable xvfb qtmultimedia5-dev \ && echo 'Install some more packages' \ && DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --no-install-recommends \ - gnupg gcc clang nodejs + gnupg gcc clang "nodejs=${NODE_MAJOR}.*" WORKDIR /usr/lib/ COPY package.json package-lock.json ./ -RUN npm install +RUN npm --global install WORKDIR /tmp/