diff --git a/CHANGELOG.md b/CHANGELOG.md index 13d8e0a..46eb8b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Security +- Added exception for `@nationalarchives/*` from the npm cooldown +- Fixed npm version with `NPM_VERSION` environment variable + ## [1.17.0](https://github.com/nationalarchives/docker/compare/v1.16.0...v1.17.0) - 2026-06-29 ### Changed @@ -45,7 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Security -- Added exceptions for `tna-frontend-jinja` and `tna-utilities` from the 7 day cooldown for Poetry and `@nationalarchives/eslint-config` and `@nationalarchives/stylelint-config` for npm +- Added exceptions for `tna-frontend-jinja` and `tna-utilities` from the 7 day cooldown for Poetry ## [1.15.0](https://github.com/nationalarchives/docker/compare/v1.14.0...v1.15.0) - 2026-06-04 diff --git a/docker/tna-python/Dockerfile b/docker/tna-python/Dockerfile index 39e591c..d6b5646 100644 --- a/docker/tna-python/Dockerfile +++ b/docker/tna-python/Dockerfile @@ -73,6 +73,7 @@ ENV PIP_NO_CACHE_DIR=true \ # > docs.docker.com/build/building/variables # ========================================== ENV NODEJS_VERSION=24.17.0 \ + NPM_VERSION=12.0.0 \ PIP_VERSION=26.1 \ POETRY_VERSION=2.4.1 \ NVM_VERSION=0.40.5 \ @@ -86,6 +87,7 @@ ENV NODEJS_VERSION=24.17.0 \ # ========================================== LABEL uk.gov.nationalarchives.python-version="$PYTHON_VERSION" LABEL uk.gov.nationalarchives.nodejs-version="$NODEJS_VERSION" +LABEL uk.gov.nationalarchives.npm-version="$NPM_VERSION" LABEL uk.gov.nationalarchives.pip-version="$PIP_VERSION" LABEL uk.gov.nationalarchives.poetry-version="$POETRY_VERSION" LABEL uk.gov.nationalarchives.nvm-version="$NVM_VERSION" @@ -204,14 +206,16 @@ ENV PATH="$POETRY_HOME/bin:$PATH" USER app # ========================================== -# Install Node.js using nvm using the latest -# npm version and set it as the default +# Install Node.js with nvm using the version +# we specified, set it as the default one to +# use, and then update npm # ========================================== # hadolint ignore=SC1091 RUN . "$NVM_DIR/nvm.sh"; \ - nvm install --latest-npm "$NODEJS_VERSION"; \ + nvm install "$NODEJS_VERSION"; \ nvm alias default "$NODEJS_VERSION"; \ - nvm use default + nvm use default; \ + npm install -g npm@"$NPM_VERSION" # ========================================== # Create a directory for our SSL certificate diff --git a/docker/tna-python/bin/tna-nvm b/docker/tna-python/bin/tna-nvm index 0659888..1f099e8 100755 --- a/docker/tna-python/bin/tna-nvm +++ b/docker/tna-python/bin/tna-nvm @@ -14,4 +14,5 @@ else fi npm config set min-release-age="$COOLDOWN_PERIOD" --location=global +npm config set min-release-age-exclude="@nationalarchives/*" --location=global npm config set fund=false --location=global