File tree Expand file tree Collapse file tree 2 files changed +12
-16
lines changed
Expand file tree Collapse file tree 2 files changed +12
-16
lines changed Original file line number Diff line number Diff line change 11# EXPERIMENTAL Docker support for angular2 build process.
2- # Build with: docker build -t $USER/angular :$(git rev-list -n 1 HEAD) .
2+ # Build with: docker build -t $USER/angular2 :$(git rev-list -n 1 HEAD) .
33FROM node:5.7.1
44MAINTAINER Alex Eagle
55
6- # Don't run as root. bower complains, and it is less secure.
7- RUN useradd -ms /bin/bash ngbuilder
6+ # Copy the minimal file to create a node_modules directory.
7+ # This takes advantage of docker's caching, so that the npm install
8+ # is only re-run when the npm-shrinkwrap.json was modified.
9+ COPY npm-shrinkwrap.json /home/
10+ WORKDIR /home
11+ RUN npm install --no-progress
812
9- # Copy only the shrinkwrapped dependencies
10- COPY npm-shrinkwrap.json /home/ngbuilder/
11- WORKDIR /home/ngbuilder
12- # This install command results in a cachable node_modules directory
13- RUN npm install --silent
14-
15- COPY . /home/ngbuilder/
16- # https://docs.docker.com/engine/reference/builder/#copy
17- # All new files and directories are created with a UID and GID of 0.
18- RUN chown -R ngbuilder:ngbuilder /home/ngbuilder
19- USER ngbuilder
20- ENV HOME /home/ngbuilder
13+ COPY . /home/
2114
15+ # Allow the build to run as root. In a long-lived docker container,
16+ # this is a security vulnerability, but we don't have a CMD so our
17+ # container is not left running after the build completes.
2218RUN npm run postinstall
2319RUN npm run build
Original file line number Diff line number Diff line change 2727 },
2828 "scripts" : {
2929 "preinstall" : " node tools/analytics/build-analytics start install npm3-install && node tools/analytics/build-analytics start install npm-preinstall && node tools/npm/check-node-modules && node tools/analytics/build-analytics success install npm-preinstall && node tools/analytics/build-analytics start install npm-install-net" ,
30- "postinstall" : " node tools/analytics/build-analytics success install npm-install-net && node tools/analytics/build-analytics start install npm-postinstall && node tools/npm/copy-npm-shrinkwrap && node tools/chromedriverpatch.js && webdriver-manager update && bower install && gulp pubget.dart && npm run typings && node tools/analytics/build-analytics success install npm-postinstall && node tools/analytics/build-analytics success install npm3-install" ,
30+ "postinstall" : " node tools/analytics/build-analytics success install npm-install-net && node tools/analytics/build-analytics start install npm-postinstall && node tools/npm/copy-npm-shrinkwrap && node tools/chromedriverpatch.js && webdriver-manager update && bower install --allow-root && gulp pubget.dart && npm run typings && node tools/analytics/build-analytics success install npm-postinstall && node tools/analytics/build-analytics success install npm3-install" ,
3131 "build" : " node --max-old-space-size=2048 ./node_modules/.bin/gulp build.js" ,
3232 "test" : " gulp test.all.js && gulp test.all.dart" ,
3333 "typings" : " tsd reinstall --overwrite --clean --config modules/angular2/tsd.json && tsd reinstall --overwrite --clean --config tools/tsd.json && tsd reinstall --overwrite --config modules/angular1_router/tsd.json"
You can’t perform that action at this time.
0 commit comments