From 4cfd16d6e1298bb2f936726dcc1e31801e785de6 Mon Sep 17 00:00:00 2001 From: rintisch Date: Fri, 17 Nov 2023 19:17:56 +0100 Subject: [PATCH] Update `nodejs`, include `npm` --- .github/workflows/docker_publish.yml | 2 ++ CHANGELOG.md | 4 ++++ Dockerfile | 27 +++++++++++++++++++++++---- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish.yml index 8cb7aae..a09ad56 100644 --- a/.github/workflows/docker_publish.yml +++ b/.github/workflows/docker_publish.yml @@ -2,6 +2,8 @@ name: Docker on: push: + branches: + - task/update-npm tags: - v* diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c37e3f..e682dc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [3.2.0] - 2023-11-17 +### Updated +* Update `nodejs` version which also contains `npm` + ## [3.1.0] - 2023-09-19 ### Added * Add apt package `patch` to enable installation of patches. diff --git a/Dockerfile b/Dockerfile index f1cebb2..a1f53e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,18 @@ ENV TYPO3_CONTEXT=Production/Live \ # see https://github.com/hadolint/hadolint/wiki/DL4006 SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Install needed packages, set time zone +RUN apt-get update && \ + apt-get install -yqq --no-install-recommends --no-install-suggests \ + ca-certificates curl gnupg && \ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + NODE_MAJOR=20 && \ + echo "deb [signed-by=/etc/apt/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 --no-install-recommends --no-install-suggests -y \ + nodejs && \ + node -v && \ + npm -v + RUN apt-get update && \ apt-get install -yqq --no-install-recommends --no-install-suggests \ apache2-utils \ @@ -80,13 +92,20 @@ RUN apt-get update && \ php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Composer Installer verified'; } else { echo 'Composer Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \ php composer-setup.php --install-dir=/usr/bin --filename=composer && \ php -r "unlink('composer-setup.php');" && \ - # Install yarn & nodejs v16 - curl -sL https://deb.nodesource.com/setup_16.x | bash - && \ + # Install nodejs v20 (npm is included) + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + NODE_MAJOR=20 && \ + echo "deb [signed-by=/etc/apt/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 --no-install-recommends --no-install-suggests -y \ + nodejs && \ + node -v && \ + npm -v && \ + # Install yarn (for backwards compatibility, should be dropped in v4) curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ apt-get update && apt-get install --no-install-recommends --no-install-suggests -y\ - yarn \ - nodejs && \ + yarn && \ # set timezone cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime && \ # install supercronic for cron job