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"