From 56811a7e624022132f2725b02c9f0fe87a7cbdc9 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 29 Oct 2021 00:55:37 +0200 Subject: [PATCH 1/7] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1b42bea2db..d6ea1a3dc6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # # --- Base Node Image --- -FROM node:14-alpine AS base +FROM node:lts-alpine AS base RUN apk update; \ apk add git; @@ -23,7 +23,7 @@ RUN npm run prepare && npm run build # # --- Production Image --- -FROM node:14-alpine AS release +FROM node:lts-alpine AS release WORKDIR /src # Copy production node_modules From 407aac2d53ffc0f81751b9f62b42488735ac3bcb Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 29 Oct 2021 00:58:28 +0200 Subject: [PATCH 2/7] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d6ea1a3dc6..54d9f6044c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN npm install --only=production # Copy production node_modules aside for later RUN cp -R node_modules prod_node_modules # Install remaining dev dependencies -RUN npm install +RUN npm ci COPY . /src From eb31954a9e2c351d8421af2e44da4f9d2bc47f14 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 29 Oct 2021 01:06:11 +0200 Subject: [PATCH 3/7] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 54d9f6044c..8b74251315 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,12 +4,12 @@ FROM node:lts-alpine AS base RUN apk update; \ apk add git; - WORKDIR /src # Copy package.json first to benefit from layer caching COPY package*.json ./ -RUN npm install --only=production + +RUN npm ci --production --ignore-scripts # Copy production node_modules aside for later RUN cp -R node_modules prod_node_modules # Install remaining dev dependencies From 66817c4d37622d57bf55e45bf041278c694e5fc4 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 29 Oct 2021 01:17:08 +0200 Subject: [PATCH 4/7] Update Dockerfile --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8b74251315..e039d368ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,11 +12,12 @@ COPY package*.json ./ RUN npm ci --production --ignore-scripts # Copy production node_modules aside for later RUN cp -R node_modules prod_node_modules -# Install remaining dev dependencies -RUN npm ci COPY . /src +# Install remaining dev dependencies +RUN npm ci + # Run all webpack build steps RUN npm run prepare && npm run build From e23b40061b58e54f3b5d6bc737efb7827efdafa3 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 29 Oct 2021 01:24:15 +0200 Subject: [PATCH 5/7] Update Dockerfile --- Dockerfile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e039d368ff..afb3bfe756 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ -# -# --- Base Node Image --- +############################################################ +# Build stage +############################################################ FROM node:lts-alpine AS base RUN apk update; \ @@ -9,10 +10,13 @@ WORKDIR /src # Copy package.json first to benefit from layer caching COPY package*.json ./ +# Install without scripts otherwise webpack will fail RUN npm ci --production --ignore-scripts + # Copy production node_modules aside for later RUN cp -R node_modules prod_node_modules +# Copy src to have webpack config files ready for install COPY . /src # Install remaining dev dependencies @@ -21,9 +25,9 @@ RUN npm ci # Run all webpack build steps RUN npm run prepare && npm run build - -# -# --- Production Image --- +############################################################ +# Release stage +############################################################ FROM node:lts-alpine AS release WORKDIR /src From b0a3f2a8c2a9ee12b036a691cdf7df02015fd196 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 29 Oct 2021 01:26:01 +0200 Subject: [PATCH 6/7] Update Dockerfile --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index afb3bfe756..717bcbf2a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,11 +16,12 @@ RUN npm ci --production --ignore-scripts # Copy production node_modules aside for later RUN cp -R node_modules prod_node_modules -# Copy src to have webpack config files ready for install -COPY . /src +# Copy webpack config files for install +COPY webpack /src/webpack # Install remaining dev dependencies RUN npm ci +COPY . /src # Run all webpack build steps RUN npm run prepare && npm run build From 3f4ff5d87aee5224e01fdb9534cfd18513b14dd7 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 29 Oct 2021 01:30:26 +0200 Subject: [PATCH 7/7] Update Dockerfile --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 717bcbf2a0..afb3bfe756 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,12 +16,11 @@ RUN npm ci --production --ignore-scripts # Copy production node_modules aside for later RUN cp -R node_modules prod_node_modules -# Copy webpack config files for install -COPY webpack /src/webpack +# Copy src to have webpack config files ready for install +COPY . /src # Install remaining dev dependencies RUN npm ci -COPY . /src # Run all webpack build steps RUN npm run prepare && npm run build