-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# compiled output | ||
/dist | ||
/tmp | ||
/out-tsc | ||
|
||
# dependencies | ||
/node_modules | ||
|
||
# profiling files | ||
chrome-profiler-events.json | ||
speed-measure-plugin.json | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# IDE - VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
.history/* | ||
|
||
# misc | ||
/.sass-cache | ||
/connect.lock | ||
/coverage | ||
/libpeerconnection.log | ||
npm-debug.log | ||
yarn-error.log | ||
testem.log | ||
/typings | ||
|
||
# System Files | ||
.DS_Store | ||
Thumbs.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM node:10.15.0-alpine | ||
ENV HOME=/usr/src/app | ||
|
||
# Create simple server that hosts compiled Angular Resources | ||
WORKDIR $HOME | ||
COPY ./package.json $HOME/ | ||
RUN npm install --quiet | ||
RUN node simple-server.js & | ||
|
||
#Set up angular code and dependencies | ||
WORKDIR $HOME/angular-code | ||
COPY ./angular-code/package.json $HOME/angular-code | ||
RUN npm install --quiet | ||
COPY . $HOME | ||
EXPOSE 4200 | ||
WORKDIR $HOME/angular-code | ||
|
||
# Main container process builds angular code to angular-output/ folder | ||
CMD node ../simple-server.js & npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import cdk = require('@aws-cdk/cdk'); | ||
import s3 = require('@aws-cdk/aws-s3'); | ||
import s3Deploy = require('@aws-cdk/aws-s3-deployment'); | ||
import {CloudFrontWebDistribution} from '@aws-cdk/aws-cloudfront'; | ||
|
||
export class ClientUIConstruct extends cdk.Construct { | ||
constructor(parent: cdk.Construct, name: string) { | ||
super(parent, name); | ||
const clientUIAssetsBucket = new s3.Bucket(this, 'Client UI Assets Bucket', { | ||
websiteIndexDocument: 'index.html', | ||
websiteErrorDocument: 'error.html', | ||
removalPolicy: cdk.RemovalPolicy.Destroy | ||
}); | ||
clientUIAssetsBucket.grantPublicAccess('*', 's3:GetObject'); | ||
|
||
new s3Deploy.BucketDeployment(this, 'Client UI Deployment', { | ||
source: s3Deploy.Source.asset('client-ui/assets'), | ||
destinationBucket: clientUIAssetsBucket | ||
}); | ||
|
||
new CloudFrontWebDistribution(this, 'Client UI CDN Distribution', { | ||
originConfigs: [ | ||
{ | ||
s3OriginSource: { | ||
s3BucketSource: clientUIAssetsBucket | ||
}, | ||
behaviors : [ {isDefaultBehavior: true}], | ||
|
||
} | ||
] | ||
}); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "server", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "simple-server.js", | ||
"dependencies": { | ||
"express": "^4.16.4" | ||
}, | ||
"devDependencies": {}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "ISC" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var express = require('express'); | ||
var app = express(); | ||
app.use(express.static('../angular-output')); | ||
app.listen(4200); |