From 30321638143c16163e0c78dbf3771f049d1cd932 Mon Sep 17 00:00:00 2001 From: pheiduck <47042125+pheiduck@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:40:11 +0100 Subject: [PATCH 1/5] bump to node 20 --- .github/workflows/lint.yml | 2 +- .github/workflows/npm-update-bot.yml | 2 +- Dockerfile | 7 ++----- src/package-lock.json | 2 +- src/package.json | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 088710a..6a38a60 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: '18' + node-version: '20' check-latest: true cache: 'npm' cache-dependency-path: | diff --git a/.github/workflows/npm-update-bot.yml b/.github/workflows/npm-update-bot.yml index ab5e0fb..1bfa47a 100644 --- a/.github/workflows/npm-update-bot.yml +++ b/.github/workflows/npm-update-bot.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: '18' + node-version: '20' check-latest: true cache: 'npm' cache-dependency-path: | diff --git a/Dockerfile b/Dockerfile index fe3ae8d..ee9af98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,4 @@ -# There's an issue with node:20-alpine. -# Docker deployment is canceled after 25< minutes. - -FROM docker.io/library/node:18-alpine AS build_node_modules +FROM docker.io/library/node:20-alpine AS build_node_modules # Copy Web UI COPY src/ /app/ @@ -11,7 +8,7 @@ RUN npm ci --omit=dev &&\ # Copy build result to a new image. # This saves a lot of disk space. -FROM docker.io/library/node:18-alpine +FROM docker.io/library/node:20-alpine COPY --from=build_node_modules /app /app # Move node_modules one directory up, so during development diff --git a/src/package-lock.json b/src/package-lock.json index 3e72882..74f4c21 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -21,7 +21,7 @@ "tailwindcss": "^3.4.3" }, "engines": { - "node": "18" + "node": "20" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/src/package.json b/src/package.json index d98a388..f835957 100644 --- a/src/package.json +++ b/src/package.json @@ -30,6 +30,6 @@ ] }, "engines": { - "node": "18" + "node": "20" } } From c8224f34f96f0f4675744b4ed55ca42e4507998f Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:04:38 +0200 Subject: [PATCH 2/5] Dockerfile: use nodejs 18 for build workaround to get nodejs 20 working on older arm architectures --- Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index ee9af98..fc0c85c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,11 @@ -FROM docker.io/library/node:20-alpine AS build_node_modules +FROM docker.io/library/node:18-alpine AS build_node_modules # Copy Web UI COPY src/ /app/ WORKDIR /app RUN npm ci --omit=dev &&\ + # Enable this to run `npm run serve` + npm i -g nodemon &&\ mv node_modules /node_modules # Copy build result to a new image. @@ -20,11 +22,8 @@ COPY --from=build_node_modules /app /app # than what runs inside of docker. COPY --from=build_node_modules /node_modules /node_modules -RUN \ - # Enable this to run `npm run serve` - npm i -g nodemon &&\ - # Delete unnecessary files - npm cache clean --force && rm -rf ~/.npm +# Delete unnecessary files +RUN npm cache clean --force && rm -rf ~/.npm # Install Linux packages RUN apk add --no-cache \ From 6e7f2f730e987dc983b9f0029bc6b5c7fa97f2e1 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:07:45 +0200 Subject: [PATCH 3/5] Dockerfile: move all npm steps --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index fc0c85c..a71256f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,8 @@ WORKDIR /app RUN npm ci --omit=dev &&\ # Enable this to run `npm run serve` npm i -g nodemon &&\ + # Delete unnecessary files + npm cache clean --force && rm -rf ~/.npm mv node_modules /node_modules # Copy build result to a new image. @@ -22,9 +24,6 @@ COPY --from=build_node_modules /app /app # than what runs inside of docker. COPY --from=build_node_modules /node_modules /node_modules -# Delete unnecessary files -RUN npm cache clean --force && rm -rf ~/.npm - # Install Linux packages RUN apk add --no-cache \ dpkg \ From e6db5e8b7ff0852a4c914372d46bb00ac5796e5b Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:09:18 +0200 Subject: [PATCH 4/5] Dockerfile: missing operator --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a71256f..c7ca293 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN npm ci --omit=dev &&\ # Enable this to run `npm run serve` npm i -g nodemon &&\ # Delete unnecessary files - npm cache clean --force && rm -rf ~/.npm + npm cache clean --force && rm -rf ~/.npm &&\ mv node_modules /node_modules # Copy build result to a new image. From 6b284cb27c8850227833500a380425ae062f43d0 Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:20:43 +0200 Subject: [PATCH 5/5] Dockerfile: add note --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index c7ca293..cdae1ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +# As a workaround we have to build on nodejs 18 +# nodejs 20 hangs on build with armv6/armv7 FROM docker.io/library/node:18-alpine AS build_node_modules # Copy Web UI