From df89cbffff4b08f801258fb7635b557040fb430b Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Fri, 29 Oct 2021 01:37:52 +0200 Subject: [PATCH] ci: fix docker CI with lts-alpine (#1899) --- Dockerfile | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1b42bea2db..afb3bfe756 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,34 @@ -# -# --- Base Node Image --- -FROM node:14-alpine AS base +############################################################ +# Build stage +############################################################ +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 + +# 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 -# Install remaining dev dependencies -RUN npm install +# Copy src to have webpack config files ready for install COPY . /src +# Install remaining dev dependencies +RUN npm ci + # Run all webpack build steps RUN npm run prepare && npm run build - -# -# --- Production Image --- -FROM node:14-alpine AS release +############################################################ +# Release stage +############################################################ +FROM node:lts-alpine AS release WORKDIR /src # Copy production node_modules