CyberChef/Dockerfile
GCHQDeveloper581 1fdd2ecf20
Node version update from 22 to 24 (#2347)
Changes mostly authored-by: Leon Zandman <leon@wirwar.com>
Cherry pick and minor additions by GCHQDeveloper581 <63102987+GCHQDeveloper581@users.noreply.github.com>
2026-04-28 13:18:02 +01:00

34 lines
1.1 KiB
Docker

#####################################
# Build the app to a static website #
#####################################
# Modifier --platform=$BUILDPLATFORM limits the platform to "BUILDPLATFORM" during buildx multi-platform builds
# This is because npm "chromedriver" package is not compatiable with all platforms
# For more info see: https://docs.docker.com/build/building/multi-platform/#cross-compilation
FROM --platform=$BUILDPLATFORM node:24-alpine AS builder
WORKDIR /app
COPY package.json .
COPY package-lock.json .
# Install dependencies
# --ignore-scripts prevents postinstall script (which runs grunt) as it depends on files other than package.json
RUN npm ci --ignore-scripts
# Copy files needed for postinstall and build
COPY . .
# npm postinstall runs grunt, which depends on files other than package.json
RUN npm run postinstall
# Build the app
RUN npm run build
#########################################
# Package static build files into nginx #
#########################################
FROM nginxinc/nginx-unprivileged:stable-alpine AS cyberchef
LABEL maintainer="GCHQ <oss@gchq.gov.uk>"
COPY --from=builder /app/build/prod /usr/share/nginx/html/