From 4debf2f631a50291d6f24eb460e58d0126591012 Mon Sep 17 00:00:00 2001 From: Vladlen Date: Mon, 27 May 2024 11:01:16 +0300 Subject: [PATCH] fix gateway issues --- gateway/Dockerfile | 20 +++++++++---------- .../controllers/images.controller.ts | 11 +--------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/gateway/Dockerfile b/gateway/Dockerfile index cf0b5e0..9851983 100644 --- a/gateway/Dockerfile +++ b/gateway/Dockerfile @@ -1,27 +1,27 @@ -FROM node:20-alpine As development +FROM node:20-alpine AS development WORKDIR /usr/src/app -COPY --chown=node:node package*.json ./ +COPY --chown=node:node --chmod=644 package*.json ./ RUN npm ci -COPY --chown=node:node . . +COPY --chown=node:node --chmod=644 . . USER node -FROM node:20-alpine As build +FROM node:20-alpine AS build WORKDIR /usr/src/app -COPY --chown=node:node package*.json ./ -COPY --chown=node:node --from=development /usr/src/app/node_modules ./node_modules -COPY --chown=node:node . . +COPY --chown=node:node --chmod=644 package*.json ./ +COPY --chown=node:node --chmod=644 --from=development /usr/src/app/node_modules ./node_modules +COPY --chown=node:node --chmod=644 . . RUN npm run build ENV NODE_ENV production RUN npm ci --only=production && npm cache clean --force USER node -FROM node:20-alpine As production +FROM node:20-alpine AS production -COPY --chown=node:node --from=build /usr/src/app/node_modules ./node_modules -COPY --chown=node:node --from=build /usr/src/app/dist ./dist +COPY --chown=node:node --chmod=644 --from=build /usr/src/app/node_modules ./node_modules +COPY --chown=node:node --chmod=644 --from=build /usr/src/app/dist ./dist EXPOSE 3000 diff --git a/gateway/src/classifiers/controllers/images.controller.ts b/gateway/src/classifiers/controllers/images.controller.ts index 485c2ea..a91a397 100644 --- a/gateway/src/classifiers/controllers/images.controller.ts +++ b/gateway/src/classifiers/controllers/images.controller.ts @@ -1,12 +1,4 @@ -import { - Controller, - Next, - Post, - Req, - Res, - UseGuards, - UseInterceptors, -} from '@nestjs/common'; +import { Controller, Next, Post, Req, Res, UseGuards } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { RequestHandler } from 'http-proxy-middleware'; import { IncomingMessage, ServerResponse } from 'http'; @@ -20,7 +12,6 @@ import { ApiTags, } from '@nestjs/swagger'; import { JwtAuthGuard } from '../../shared/guards/jwt-auth.guard'; -import { FileInterceptor } from '@nestjs/platform-express'; @ApiTags('image classifiers') @ApiBearerAuth('Access Token')