build: pin docker base images by digest

Floating tags node:22-alpine and nginx:1.27-alpine let upstream
swap image contents without review. Pin both FROM lines to their
current digest per the supply-chain policy, keeping the tag as
a trailing comment for readability.
This commit is contained in:
L'électron rare
2026-07-09 12:40:21 +02:00
parent 311cd58a6e
commit 41a12724f6
+4 -2
View File
@@ -1,10 +1,12 @@
FROM node:22-alpine AS build FROM node:22-alpine@sha256:16e22a550f3863206a3f701448c45f7912c6896a62de43add43bb9c86130c3e2 AS build
# node:22-alpine
WORKDIR /app WORKDIR /app
COPY package.json package-lock.json ./ COPY package.json package-lock.json ./
RUN npm ci RUN npm ci
COPY . . COPY . .
RUN npm run build RUN npm run build
FROM nginx:1.27-alpine FROM nginx:1.27-alpine@sha256:65645c7bb6a0661892a8b03b89d0743208a18dd2f3f17a54ef4b76fb8e2f2a10
# nginx:1.27-alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/dist /usr/share/nginx/html