My Dockerfile for Angular App
FROM node:10.15.3-alpine as builder
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
RUN apk add git
COPY package*.json /usr/src/app/
RUN npm i
COPY . /usr/src/app
RUN npm run-script build
It exits on last step with the following error:
npm ERR! missing script: build
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-05-24T09_05_54_385Z-debug.log
Is run-script missing or build option in this case? and how to fix or what's the alternative??
script-section of package.json
"scripts": {
"ng": "ng",
"edu-start": "ng serve --project edu-app",
"edu-start-with-api": "ng serve --project edu-app --configuration local_api",
"edu-start-with-nodejs": "ng serve --project edu-app --configuration local_nodejs",
"edu-build-dev": "node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng build --project edu-app --configuration hmr",
"edu-build-prod": "node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng build --project edu-app --configuration production --prod",
"air-pilot-start": "ng serve --project air-pilot-app",
"air-pilot-build-dev": "node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng build --project air-pilot-app --configuration hmr",
"air-pilot-build-prod": "node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng build --project air-pilot-app --configuration production --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"bundle-report": "webpack-bundle-analyzer dist/stats.json"
},
I tried this too instead, but neither worked, complains that ng Not Found
RUN ng build --prod --project edu-app
scriptssection of yourpackage.json.