mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-26 09:46:17 -04:00
Docker multiplatform build support. Pending CI workflow test
This commit is contained in:
parent
e48fc4c8d8
commit
f8b613b4e7
2 changed files with 26 additions and 5 deletions
29
Dockerfile
29
Dockerfile
|
@ -1,9 +1,30 @@
|
|||
FROM node:18-alpine AS build
|
||||
#####################################
|
||||
# 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:18-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json .
|
||||
COPY package-lock.json .
|
||||
|
||||
# Install dependencies
|
||||
# --ignore-scripts do not run grunt postinstall script as it depends on files other than package.json
|
||||
RUN npm ci --ignore-scripts
|
||||
|
||||
# Build the app
|
||||
COPY . .
|
||||
RUN npm ci
|
||||
|
||||
# npm postinstall runs grunt, which depends on files other than package.json
|
||||
RUN npm run postinstall
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.25-alpine3.18 AS cyberchef
|
||||
#########################################
|
||||
# Package static build files into nginx #
|
||||
#########################################
|
||||
FROM nginx:stable-alpine AS cyberchef
|
||||
|
||||
COPY --from=build ./build/prod /usr/share/nginx/html/
|
||||
COPY --from=builder /app/build/prod /usr/share/nginx/html/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue