From 530c1f06d9e0ebc8e6889e8d34b3ce2e2ff2d035 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 29 Oct 2021 17:32:06 +0200 Subject: [PATCH] Update Dockerfile --- Dockerfile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0749e8d841..a351d090d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,30 @@ +############################################################ # Build stage +############################################################ FROM node:lts-alpine as build RUN apk update; \ apk add git; WORKDIR /tmp + +# Copy package.json first to benefit from layer caching COPY package*.json ./ -# Copy local dependencies for CI tests -COPY spec/dependencies spec/dependencies +# Copy src to have config files for install +COPY . . +# Clean npm cache; added to fix an issue with the install process RUN npm cache clean --force + +# Install all dependencies RUN npm ci -COPY . . + +# Run build steps RUN npm run build +############################################################ # Release stage +############################################################ FROM node:lts-alpine as release RUN apk update; \ @@ -26,6 +36,7 @@ WORKDIR /parse-server COPY package*.json ./ +# Clean npm cache; added to fix an issue with the install process RUN npm cache clean --force RUN npm ci --production --ignore-scripts