From aa80d6ec431e3b62beb26dba0fcc220ad27aaaf0 Mon Sep 17 00:00:00 2001 From: "S. Amir Mohammad Najafi" Date: Sat, 26 Nov 2022 18:37:12 +0330 Subject: [PATCH] feat(storage-server): dockerfile --- packages/service/storage-server/Dockerfile | 16 +++++++++++----- .../service/storage-server/src/lib/config.ts | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/service/storage-server/Dockerfile b/packages/service/storage-server/Dockerfile index a671732bb..484b9c368 100644 --- a/packages/service/storage-server/Dockerfile +++ b/packages/service/storage-server/Dockerfile @@ -1,8 +1,8 @@ -FROM node:18-alpine +ARG NODE_VERSION=18 -LABEL maintainer="S. Ali Mihandoost " +FROM node:${NODE_VERSION}-alpine -ENV NODE_ENV production +LABEL maintainer="S. Ali Mihandoost " WORKDIR /app @@ -11,9 +11,15 @@ WORKDIR /app COPY package.json ./ -RUN yarn install --frozen-lockfile --production=true --non-interactive +RUN yarn install --frozen-lockfile --non-interactive -COPY dist . +COPY . . + +RUN yarn build + +ENV PORT 80 +ENV TOKEN ${STORAGE_TOKEN} +ENV NODE_ENV production EXPOSE 80 diff --git a/packages/service/storage-server/src/lib/config.ts b/packages/service/storage-server/src/lib/config.ts index 3474bfaed..9a1d535a5 100644 --- a/packages/service/storage-server/src/lib/config.ts +++ b/packages/service/storage-server/src/lib/config.ts @@ -1,6 +1,6 @@ import {createLogger} from '@alwatr/logger'; -export const logger = createLogger('service-storage'); +export const logger = createLogger('storage-server'); export const config = { host: process.env.HOST ?? '0.0.0.0',