I am building docker image but getting following error
For more detailed help run "ng [command name] --help" FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
<--- Last few GCs --->
[16:0x558f56668dc0] 212695 ms: Mark-sweep 971.6 (995.9) -> 965.5 (996.9) MB, 1703.2 / 0.0 ms (average mu = 0.126, current mu = 0.019) allocation failure scavenge might not succeed [16:0x558f56668dc0] 214464 ms: Mark-sweep 972.6 (996.9) -> 966.4 (997.6) MB, 1742.9 / 0.0 ms (average mu = 0.073, current mu = 0.015) allocation failure scavenge might not succeed
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x558f5378aed9]
Security context: 0x118720bc08d1 1: _walk [0x5dc516d83b9] [/usr/src/studyoptimizer/node_modules/terser/dist/bundle.min.js:~1] [pc=0x3b14ab8ca65b](this=0x0f2925361671 ,0x18b4b1df8fd1 ) 2: /* anonymous */ [0x1139625e0009] [/usr/src/studyoptimizer/node_modules/terser/dist/bundle.min.js:1] [bytecode=0x2da304fdee9 offset=44](this=...
Writing Node.js report to file: report.20200222.103313.16.0.001.json Node.js report completed
DockerFile
STAGE 1: Build
FROM node:12-alpine AS build WORKDIR /usr/src/sample COPY package.json /usr/src/sample/package.json RUN cd /usr/src/sample RUN npm install COPY . /usr/src/sample
RUN npm run build-login
STAGE 2: Run
FROM nginx:1.17.1-alpine COPY --from=build /usr/src/sample/dist/myapp /usr/share/nginx/html/dv/sampleapp/
In package.json file i have "build-login": "npm run build-memory && ng build login --prod --verbose", "build-memory": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng",