Adds Dockerfile and staging configuration

This commit is contained in:
Aaron Louie 2020-01-14 09:35:36 -05:00
parent 8e8e141f50
commit 7d1121365e
3 changed files with 43 additions and 0 deletions

16
Dockerfile Normal file
View File

@ -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/

View File

@ -54,6 +54,30 @@
"maximumError": "5mb" "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"
}
]
} }
} }
}, },

View File

@ -5,6 +5,9 @@
"ng": "ng", "ng": "ng",
"start": "ng serve", "start": "ng serve",
"build": "ng build", "build": "ng build",
"build:prod": "ng build --configuration=production",
"build:staging": "ng build --configuration=staging",
"build:test": "ng build --configuration=test",
"test": "ng test", "test": "ng test",
"lint": "ng lint", "lint": "ng lint",
"e2e": "./node_modules/protractor/bin/webdriver-manager update && ng e2e" "e2e": "./node_modules/protractor/bin/webdriver-manager update && ng e2e"