From cca6c11d31350cc3d9911d79825447220910c714 Mon Sep 17 00:00:00 2001 From: Said Sef Date: Thu, 3 Sep 2026 00:41:40 +0100 Subject: [PATCH 1/2] feat(docker): update base container to v26 --- Dockerfile | 18 ++++++++++-------- build.sh => scripts/build.sh | 0 2 files changed, 10 insertions(+), 8 deletions(-) rename build.sh => scripts/build.sh (100%) diff --git a/Dockerfile b/Dockerfile index 11b2f0a..bff45f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,18 @@ -FROM docker.io/node:24-alpine3.20 +FROM docker.io/node:26-alpine3.24 + +LABEL org.opencontainers.image.authors="Said Sef (saidsef.co.uk/)" +LABEL org.opencontainers.image.title="Node Application Web Server" +LABEL org.opencontainers.image.description="This is used to test container platform builds such as Kubernetes and other container schedulers." -LABEL maintainer="Said Sef (saidsef.co.uk/)" ARG BUILD_ID="" ARG PORT="" -ENV NODE_ENV production -ENV NPM_CONFIG_FETCH_RETRIES 10 -ENV NPM_CONFIG_LOGLEVEL warn -ENV BUILD_ID ${BUILD_ID:-'0.0.0.0-boo!'} -ENV PORT ${PORT:-8080} +ENV NODE_ENV=production +ENV NPM_CONFIG_FETCH_RETRIES=10 +ENV NPM_CONFIG_LOGLEVEL=warn +ENV BUILD_ID=${BUILD_ID:-'0.0.0.0-boo!'} +ENV PORT=${PORT:-8080} WORKDIR /code COPY ./app/ /code @@ -27,7 +30,6 @@ USER nobody EXPOSE ${PORT} -# health check endpoint HEALTHCHECK --interval=60s --timeout=10s CMD curl --fail 'http://localhost:${PORT}/healthz' || exit 1 CMD /usr/local/bin/node index.js diff --git a/build.sh b/scripts/build.sh similarity index 100% rename from build.sh rename to scripts/build.sh From 67ec47415f3fe28e6f614f9c1cfedcab7e288e3b Mon Sep 17 00:00:00 2001 From: Said Sef Date: Thu, 3 Sep 2026 00:45:37 +0100 Subject: [PATCH 2/2] fix(docker): install dependencies with npm The node:26 images no longer bundle yarn, so the install layer exited 127 on `yarn: not found` and the image would not build at all. I swapped it for `npm install --omit=dev`, using the npm 11.19.0 that already ships in the base. `yarn check` and `yarn autoclean` came out with it. Neither has an npm equivalent, and there is no lock file under app/ for a check to verify against. `npm cache clean --force` does what autoclean did for the layer size. --- Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index bff45f4..1092d99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,10 +20,8 @@ COPY ./app/ /code RUN echo "${BUILD_ID}" > build_id.txt RUN apk add --update --no-cache curl && \ rm -rfv /var/cache/apk/* && \ - yarn install --prod && \ - yarn check && \ - yarn autoclean --init && \ - yarn autoclean --force && \ + npm install --omit=dev --no-audit --no-fund && \ + npm cache clean --force && \ chown -R nobody . USER nobody