-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* @angular/cdk@10 * @angular/material@10 * @angular/cli@10 * @angular/cli@11 * @angular/cli@11 * @angular/material@11 * @angular/cdk@12 * @angular/cli@12 * @angular/material@12 * @angular/cdk@13 * @angular/cli@13 * @angular/material@13 * @ngrx/store * apollo-angular * finish
- Loading branch information
Showing
42 changed files
with
407 additions
and
236 deletions.
There are no files selected for viewing
File renamed without changes.
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/.angular/cache | ||
.idea | ||
node_modules | ||
dist | ||
package-lock.json | ||
package-lock.json |
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,39 @@ | ||
FROM node:16-alpine AS BUILD_SERVER | ||
|
||
RUN apk update && apk add bash python3 g++ make | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/app | ||
|
||
# Bundle app source | ||
COPY ./server . | ||
|
||
RUN npm install --production | ||
|
||
FROM node:16-alpine AS BUILD_WEB | ||
|
||
RUN apk update && apk add bash python3 g++ make | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/app | ||
|
||
RUN npm i -g npm | ||
COPY package.json . | ||
|
||
# TODO pear dependecyfor appolo angular | ||
RUN npm install --force | ||
|
||
# Bundle app source | ||
COPY . . | ||
|
||
RUN npm run build:prod | ||
|
||
FROM node:16-alpine | ||
WORKDIR /usr/src/app | ||
|
||
COPY --from=BUILD_SERVER /usr/src/app/ ./ | ||
COPY --from=BUILD_WEB /usr/src/app/dist/ndfsm-frontend ./dist | ||
|
||
EXPOSE 3500 | ||
# npm to dirrect node command | ||
CMD [ "node", "app.js" ] |
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
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
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
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
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,59 @@ | ||
'use strict' | ||
|
||
const S = require('fluent-schema') | ||
const path = require('path') | ||
|
||
async function statusService (fastify, opts) { | ||
fastify.route({ | ||
method: 'GET', | ||
path: '/status', | ||
handler: onStatus, | ||
schema: { | ||
response: { | ||
200: S.object().prop('status', S.string()) | ||
} | ||
} | ||
}) | ||
|
||
async function onStatus (req, reply) { | ||
return { status: 'ok' } | ||
} | ||
} | ||
|
||
async function setup (fastify, opts) { | ||
|
||
fastify.setNotFoundHandler(onMain) | ||
|
||
await statusService(fastify) | ||
|
||
fastify.register(require('fastify-static'), { | ||
root: path.resolve(process.env.PATH_TO_APP_DIST), // TODO temporary | ||
prefix: '/', // optional: default '/' | ||
}) | ||
|
||
fastify.route({ | ||
method: 'GET', | ||
url: '/', | ||
handler: onMain | ||
}) | ||
|
||
function onMain (req, reply) { | ||
reply.sendFile('index.html') | ||
} | ||
} | ||
|
||
if (require.main !== module) { | ||
module.exports = setup | ||
return | ||
} | ||
|
||
const fastify = require('fastify')({ | ||
logger: { | ||
level: 'info' | ||
}, | ||
}) | ||
|
||
|
||
setup(fastify) | ||
.then(fastify.listen(3500, '0.0.0.0')) | ||
.then(() => console.log('Running...')) |
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,25 @@ | ||
{ | ||
"name": "web", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "app.js", | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"scripts": { | ||
"test": "standard && tap test/**/*.test.js", | ||
"start": "fastify start -l info app.js", | ||
"dev": "fastify start -l info -P app.js" | ||
}, | ||
"keywords": [], | ||
"author": "Vitalii Melnykov <fsoulmonk@gmail.com>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"fastify": "^3.27.1", | ||
"fastify-static": "^4.5.0", | ||
"fluent-schema": "^1.0.4" | ||
}, | ||
"devDependencies": { | ||
"standard": "*" | ||
} | ||
} |
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
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
Oops, something went wrong.