Skip to content

Commit

Permalink
Dockerfile, docker-compose etc.
Browse files Browse the repository at this point in the history
  * Some code fixes due to `ng build --prod` errors
  • Loading branch information
Avraham Ostreicher committed Jun 10, 2019
1 parent 1ed9da6 commit 07da56a
Show file tree
Hide file tree
Showing 10 changed files with 561 additions and 398 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git/
dist/
examples/
node_modules/
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:8

WORKDIR /usr/src/app
ADD . /usr/src/app

RUN yarn
RUN yarn build

CMD ["yarn", "serve"]
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '3'

services:
app:
build: ./
image: odmp
expose:
- 80
environment:
NODE_ENV: production
SERVER_PORT: 80
JWT_SECRET: 0a6b944d-d2fb-46fc-a85e-0295c986cd9f
MONGO_HOST: mongodb://mongo/odmp
restart: always
depends_on:
- mongo

mongo:
image: mongo:3.6
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"license": "MIT",
"scripts": {
"ng": "ng",
"serve": "node server",
"start": "concurrently -c 'yellow.bold,green.bold' -n 'SERVER,BUILD' 'nodemon server' 'ng build --watch'",
"build": "ng build --prod",
"test": "ng test",
Expand Down
4 changes: 2 additions & 2 deletions src/app/dashboard/dashboard.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { DragulaModule } from 'ng2-dragula';
/* Modules */
import { SharedModule } from '../shared/shared.module';
import { DashboardRoutingModule } from './dashboard-routing.module';
import { NgStringPipesModule } from 'angular-pipes';

/* Components */
import { DashboardComponent } from './dashboard.component';
Expand All @@ -29,7 +30,6 @@ import { EntityService } from './services/entity.service';
import { SchemaService } from './services/schema.service';

/* Pipes */
import { ReplacePipe } from 'angular-pipes';
import { FilterDragulaListPipe } from './pipes/filter-dragula-list.pipe';

@NgModule({
Expand All @@ -40,6 +40,7 @@ import { FilterDragulaListPipe } from './pipes/filter-dragula-list.pipe';
TreeModule,
DragulaModule,
DynamicFormModule,
NgStringPipesModule,
],
declarations: [
DashboardComponent,
Expand All @@ -49,7 +50,6 @@ import { FilterDragulaListPipe } from './pipes/filter-dragula-list.pipe';
EntitiesTreeComponent,
InlineEditComponent,
SidebarSystemComponent,
ReplacePipe,
InlineEditTextareaComponent,
SearchBoxComponent,
FilterDragulaListPipe,
Expand Down
30 changes: 15 additions & 15 deletions src/app/header/header.component.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<header>
<mat-toolbar color="primary">
<a [routerLink]="['/']" class="logo"></a>
<span class="example-spacer"></span>
<a class="links side" [routerLink]="['/auth/login']" *ngIf="!user">Login</a>
<div>
<a class="links side" *ngIf="user" [matMenuTriggerFor]="menu">
<mat-icon>account_circle</mat-icon>{{user.fullname}}
</a>
<mat-menu #menu="matMenu">
<button mat-menu-item *ngIf="user && user.isAdmin" [routerLink]="['/admin']">admin</button>
<button mat-menu-item (click)="logout()">logout</button>
</mat-menu>
</div>
</mat-toolbar>
</header>
<mat-toolbar color="primary">
<a [routerLink]="['/']" class="logo"></a>
<span class="example-spacer"></span>
<a class="links side" [routerLink]="['/auth/login']" *ngIf="!user">Login</a>
<div>
<a class="links side" *ngIf="user" [matMenuTriggerFor]="menu">
<mat-icon>account_circle</mat-icon>{{user.fullname}}
</a>
<mat-menu #menu="matMenu">
<button mat-menu-item *ngIf="user && user.isAdmin" [routerLink]="['/admin']">admin</button>
<button mat-menu-item (click)="logout()">logout</button>
</mat-menu>
</div>
</mat-toolbar>
</header>
2 changes: 1 addition & 1 deletion src/app/header/header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { AuthService } from '../auth/auth.service';
})
export class HeaderComponent implements OnInit {

@Input() user: Object = {};
@Input() user: any = {};

constructor(
private authService: AuthService,
Expand Down
8 changes: 6 additions & 2 deletions src/app/schema/schema.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<div>
<button mat-raised-button (click)="openUploadDialog()" [disabled]="user && !user.isAdmin">Upload new schema</button>

<button
mat-raised-button
(click)="openUploadDialog()"
[disabled]="user && !user.isAdmin">
Upload new schema
</button>
</div>
2 changes: 1 addition & 1 deletion src/app/schema/schema.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class SchemaComponent implements OnInit {

constructor(public dialog: MatDialog, public uploadService: UploadService, private authService: AuthService) {}

user: Object;
user: any;

public openUploadDialog() {
let dialogRef = this.dialog.open(DialogComponent, { width: '50%', height: '50%' });
Expand Down
Loading

0 comments on commit 07da56a

Please sign in to comment.