diff --git a/Dockerfile b/Dockerfile index aeab2c11..7099c219 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ### STAGE 1: Build ### # We label our stage as 'builder' -FROM node:18.20.5 as builder +FROM node:18.20.5 AS builder COPY ./package.json ./ COPY ./package-lock.json ./ @@ -9,7 +9,7 @@ COPY ./package-lock.json ./ RUN npm set progress=false && npm config set depth 0 && npm cache clean --force ## Storing node modules on a separate layer will prevent unnecessary npm installs at each build -RUN export NODE_OPTIONS=--max_old_space_size=8192 && npm i && mkdir /ng-app && cp -R ./node_modules ./ng-app +RUN npm i --ignore-scripts && npm run postinstall && mkdir /ng-app && cp -R ./node_modules ./ng-app COPY ./scripts/start.sh ./ng-app COPY ./scripts/fetch-conf-by-http.sh ./ng-app @@ -19,7 +19,7 @@ WORKDIR /ng-app COPY . . ## Build the angular app in production mode and store the artifacts in dist folder -RUN export NODE_OPTIONS=--max_old_space_size=8192 && npm run build +RUN npm run build ### STAGE 2: Setup ### diff --git a/docker/Dockerfile-production b/docker/Dockerfile-production index 1df89de2..95be72ca 100644 --- a/docker/Dockerfile-production +++ b/docker/Dockerfile-production @@ -1,7 +1,7 @@ ### STAGE 1: Build ### # We label our stage as 'builder' -FROM node:18.20.5 as builder +FROM node:18.20.5 AS builder COPY ./package.json ./ COPY ./package-lock.json ./ @@ -9,7 +9,7 @@ COPY ./package-lock.json ./ RUN npm set progress=false && npm config set depth 0 && npm cache clean --force ## Storing node modules on a separate layer will prevent unnecessary npm installs at each build -RUN export NODE_OPTIONS=--max_old_space_size=8192 && npm i && mkdir /ng-app && cp -R ./node_modules ./ng-app +RUN npm i && mkdir /ng-app && cp -R ./node_modules ./ng-app COPY ./scripts/start.sh ./ng-app COPY ./scripts/fetch-conf-by-http.sh ./ng-app @@ -19,7 +19,7 @@ WORKDIR /ng-app COPY . . ## Build the angular app in production mode and store the artifacts in dist folder -RUN export NODE_OPTIONS=--max_old_space_size=8192 && $(npm bin)/ng build --configuration production --aot --base-href='$ARLAS_WUI_BASE_HREF/' +RUN npm run build ### STAGE 2: Setup ### diff --git a/docker/Dockerfile-production-no-analytics b/docker/Dockerfile-production-no-analytics index 06eaeee9..95be72ca 100644 --- a/docker/Dockerfile-production-no-analytics +++ b/docker/Dockerfile-production-no-analytics @@ -1,7 +1,7 @@ ### STAGE 1: Build ### # We label our stage as 'builder' -FROM node:18.20.5 as builder +FROM node:18.20.5 AS builder COPY ./package.json ./ COPY ./package-lock.json ./ @@ -9,7 +9,7 @@ COPY ./package-lock.json ./ RUN npm set progress=false && npm config set depth 0 && npm cache clean --force ## Storing node modules on a separate layer will prevent unnecessary npm installs at each build -RUN export NODE_OPTIONS=--max_old_space_size=8192 && npm i && mkdir /ng-app && cp -R ./node_modules ./ng-app +RUN npm i && mkdir /ng-app && cp -R ./node_modules ./ng-app COPY ./scripts/start.sh ./ng-app COPY ./scripts/fetch-conf-by-http.sh ./ng-app @@ -19,7 +19,7 @@ WORKDIR /ng-app COPY . . ## Build the angular app in production mode and store the artifacts in dist folder -RUN export NODE_OPTIONS=--max_old_space_size=8192 && $(npm bin)/ng build --configuration production-no-analytics --aot --base-href='$ARLAS_WUI_BASE_HREF/' +RUN npm run build ### STAGE 2: Setup ###