瀏覽代碼

add Dockerfile

master
Christian Ziermann 4 年之前
父節點
當前提交
5d0dbcf95b
共有 4 個文件被更改,包括 38 次插入10 次删除
  1. +33
    -0
      docker/Dockerfile
  2. +0
    -3
      src/app/misc/tab/tab/tab.component.ts
  3. +5
    -2
      src/app/misc/tab/tabs/tabs.component.ts
  4. +0
    -5
      src/app/news/top-news-dashboard/top-news-dashboard.component.scss

+ 33
- 0
docker/Dockerfile 查看文件

@@ -0,0 +1,33 @@
# Dockerfile
### STAGE 1: Build ###

# We label our stage as 'builder'
FROM node:12-alpine as builder

COPY package*.json ./

RUN npm set progress=false && npm config set depth 0 && npm cache clean --force

## Storing node modules on a separate layer will prevent unnecessary npm installs at each build
RUN npm i && mkdir /ng-app && cp -R ./node_modules ./ng-app

WORKDIR /ng-app

COPY . .

RUN npm run build:ssr


### STAGE 2: Setup ###

#FROM nginx:1.13.3-alpine
FROM node:12-alpine

ENV PORT=4100

COPY --from=builder /ng-app/dist /dist

WORKDIR /
EXPOSE 4100

RUN node dist/server/main.js

+ 0
- 3
src/app/misc/tab/tab/tab.component.ts 查看文件

@@ -1,7 +1,4 @@
import { Component, OnInit, ContentChildren, Input, ViewChildren, TemplateRef } from '@angular/core';
import { TabsComponent } from '../tabs/tabs.component';
import { Template } from '@angular/compiler/src/render3/r3_ast';

@Component({
templateUrl: 'tab.component.html',
selector: 'app-tab',

+ 5
- 2
src/app/misc/tab/tabs/tabs.component.ts 查看文件

@@ -11,12 +11,14 @@ import { from } from 'rxjs';
export class TabsComponent implements OnInit, AfterContentInit {
faNewspaper = faNewspaper;
@ContentChildren(TabComponent) tabs: QueryList<TabComponent>;
@ContentChildren(TabComponent) activeTab: TabComponent;
public selectTab(tab: TabComponent): void {
// set direciton for aninmation
tab.direction = this.getTabAnimationDirection(tab);
// deactivate all tabs
this.tabs.toArray().forEach(tab => tab.active = false);
this.tabs.toArray().forEach(tab => {
tab.active = false
});

// activate the tab the user has clicked on.
tab.active = true;
@@ -56,6 +58,7 @@ export class TabsComponent implements OnInit, AfterContentInit {
constructor() { }

ngOnInit(): void {

}

}

+ 0
- 5
src/app/news/top-news-dashboard/top-news-dashboard.component.scss 查看文件

@@ -25,11 +25,6 @@
align-self: center;
}

.not-found {
width: 160em;
height: 10em;
}

@media (max-width: 600px) {
.filter-bar {
flex-flow: column;

Loading…
取消
儲存