From 7d1121365e13a1b910b66922446a515465f74bdd Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Tue, 14 Jan 2020 09:35:36 -0500 Subject: [PATCH] Adds Dockerfile and staging configuration --- Dockerfile | 16 ++++++++++++++++ angular.json | 24 ++++++++++++++++++++++++ package.json | 3 +++ 3 files changed, 43 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0b4aeb1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM node:alpine AS builder + +RUN mkdir /crc-bpmn +WORKDIR /crc-bpmn + +ADD package.json /crc-bpmn/ + +COPY . /crc-bpmn/ + +RUN npm install && \ + npm run build:staging + +FROM nginx:alpine + +COPY --from=builder /crc-bpmn/dist/* /usr/share/nginx/html/ + diff --git a/angular.json b/angular.json index b9c281c..3c91949 100644 --- a/angular.json +++ b/angular.json @@ -54,6 +54,30 @@ "maximumError": "5mb" } ] + }, + "staging": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.staging.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "2mb", + "maximumError": "5mb" + } + ] } } }, diff --git a/package.json b/package.json index b3b5d25..610b68b 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,9 @@ "ng": "ng", "start": "ng serve", "build": "ng build", + "build:prod": "ng build --configuration=production", + "build:staging": "ng build --configuration=staging", + "build:test": "ng build --configuration=test", "test": "ng test", "lint": "ng lint", "e2e": "./node_modules/protractor/bin/webdriver-manager update && ng e2e"