Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4729f08

Browse files
committed
chore(build): experimental Docker support for our build
1 parent 67d05eb commit 4729f08

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/*
2+
dist/*
3+
tmp/*
4+
.*/*

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# EXPERIMENTAL Docker support for angular2 build process.
2+
# Build with: docker build -t $USER/angular:$(git rev-list -n 1 HEAD) .
3+
FROM node:5.7.1
4+
MAINTAINER Alex Eagle
5+
6+
# Don't run as root. bower complains, and it is less secure.
7+
RUN useradd -ms /bin/bash ngbuilder
8+
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
21+
22+
RUN npm run postinstall
23+
RUN npm run build

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@
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 && 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 && 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 && 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",
32-
"test": "gulp test.all.js && gulp test.all.dart"
32+
"test": "gulp test.all.js && gulp test.all.dart",
33+
"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"
3334
},
3435
"dependencies": {
3536
"es6-shim": "^0.35.0",

0 commit comments

Comments
 (0)