From 20016c3b931b140a952069fdec1c9801364cccec Mon Sep 17 00:00:00 2001 From: FORESTIER Fabien <fabien.forestier@soprasteria.com> Date: Tue, 26 Feb 2019 10:50:45 +0100 Subject: [PATCH] Use prod command in dockerfile --- .gitignore | 4 +++- Dockerfile | 2 +- src/app.module.ts | 4 ++-- src/authentication/authentication.controller.ts | 2 +- src/authentication/authentication.service.ts | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index d2dc06c..78d2dbe 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ node_modules *.env -!template.env \ No newline at end of file +!template.env + +/dist \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 5c9a279..b3cc18c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,6 @@ RUN npm install # Bundle app source COPY . . -CMD npm run start:dev +CMD npm run start:prod EXPOSE 3000 diff --git a/src/app.module.ts b/src/app.module.ts index 07fb7a7..4f31d52 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -2,8 +2,8 @@ import { Module, MiddlewareConsumer, RequestMethod } from '@nestjs/common'; import { AppController } from './app.controller'; import { AppService } from './app.service'; import { AuthenticationModule } from './authentication/authentication.module'; -import { ConfigModule } from 'configuration/config.module'; -import { untokenize } from 'authentication/token.middleware'; +import { ConfigModule } from './configuration/config.module'; +import { untokenize } from './authentication/token.middleware'; @Module({ imports: [ConfigModule, AuthenticationModule], diff --git a/src/authentication/authentication.controller.ts b/src/authentication/authentication.controller.ts index c46684f..8f5e1fb 100644 --- a/src/authentication/authentication.controller.ts +++ b/src/authentication/authentication.controller.ts @@ -3,7 +3,7 @@ import { Controller, Get, Res, Param, Query, Body, Post, HttpCode, InternalServe import { ApiResponse, ApiUseTags, ApiOperation, ApiImplicitHeader } from '@nestjs/swagger'; import { AuthenticationService } from './authentication.service'; -import { handleError } from 'helpers'; +import { handleError } from '../helpers'; import { LoginResponse, TokenResponse, LoginForm, UserUpdateForm, JWTTokenInfo, UserInfoUpdateResponse, UserInfoWithoutPassword } from './authentication.model'; diff --git a/src/authentication/authentication.service.ts b/src/authentication/authentication.service.ts index ba1c10b..a959e1b 100644 --- a/src/authentication/authentication.service.ts +++ b/src/authentication/authentication.service.ts @@ -1,5 +1,5 @@ import { Injectable, Logger, BadRequestException, InternalServerErrorException } from '@nestjs/common'; -import { ConfigService } from 'configuration/config.service'; +import { ConfigService } from '../configuration/config.service'; import * as request from 'request-promise-native'; import * as uuid4 from 'uuid/v4'; import * as bluebird from 'bluebird'; @@ -8,7 +8,7 @@ bluebird.promisifyAll(redis); import * as jwt from 'jsonwebtoken'; import { UserInfo, JwtInfo, LoginForm, KongUserJwtCredential, JWTTokenInfo, UserUpdateForm, UserInfoWithoutPassword } from './authentication.model'; -import { handleError } from 'helpers'; +import { handleError } from '../helpers'; @Injectable() export class AuthenticationService { -- GitLab