From ade6d2c21b6f225cb918e884bdef24a8f08b375e Mon Sep 17 00:00:00 2001 From: Abhishek Mishra Date: Mon, 19 Dec 2022 18:27:32 +0530 Subject: [PATCH 1/5] Create Dockerfile --- build/Dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 build/Dockerfile diff --git a/build/Dockerfile b/build/Dockerfile new file mode 100644 index 00000000..88fa2e00 --- /dev/null +++ b/build/Dockerfile @@ -0,0 +1,25 @@ +FROM node:16 AS builder + +# Create app directory +WORKDIR /app + +#RUN cp .env .env +RUN mkdir -p broker +RUN mkdir -p redisinsight +RUN chown -R 1001:1001 broker +RUN chown -R 1001:1001 redisinsight + +COPY package.json ./ +COPY yarn.lock ./ + +# Install app dependencies +RUN yarn install + +COPY . . + +RUN npx prisma generate --schema=./apps/api/src/app/prisma/schema.prisma + +# Generate build +RUN yarn run build + +CMD [ "npx", "nx", "serve", "api" ] From c7cf79d4ea876402de1150d8327e02b44bc80828 Mon Sep 17 00:00:00 2001 From: Abhishek Mishra Date: Mon, 19 Dec 2022 18:27:51 +0530 Subject: [PATCH 2/5] Update Jenkinsfile --- build/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Jenkinsfile b/build/Jenkinsfile index fd8e661c..66d57fb6 100644 --- a/build/Jenkinsfile +++ b/build/Jenkinsfile @@ -17,7 +17,7 @@ node() { stage('docker-build') { sh ''' # docker build -f -t - docker build -f ./Dockerfile -t $docker_server/$docker_repo:$commit_id . + docker build -f ./build/Dockerfile -t $docker_server/$docker_repo:$commit_id . ''' } From e32738e789167d80061b0fb3b3519192cadf967a Mon Sep 17 00:00:00 2001 From: Abhishek Mishra Date: Fri, 6 Jan 2023 15:52:41 +0530 Subject: [PATCH 3/5] Update Dockerfile --- build/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index 88fa2e00..59fdde6d 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -15,10 +15,10 @@ COPY yarn.lock ./ # Install app dependencies RUN yarn install -COPY . . - RUN npx prisma generate --schema=./apps/api/src/app/prisma/schema.prisma +COPY . . + # Generate build RUN yarn run build From d392b9fb4a6f32513f784af7032aacb100906b9e Mon Sep 17 00:00:00 2001 From: Abhishek Mishra Date: Fri, 6 Jan 2023 16:02:21 +0530 Subject: [PATCH 4/5] Update Dockerfile --- build/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/Dockerfile b/build/Dockerfile index 59fdde6d..b3941007 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -15,6 +15,8 @@ COPY yarn.lock ./ # Install app dependencies RUN yarn install +COPY . . + RUN npx prisma generate --schema=./apps/api/src/app/prisma/schema.prisma COPY . . From c59aa117563995e4edac85a65667f9a34b519fd6 Mon Sep 17 00:00:00 2001 From: Abhishek Mishra Date: Fri, 6 Jan 2023 17:26:40 +0530 Subject: [PATCH 5/5] Update main.ts --- apps/api/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index 3487065a..be865fc4 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -48,7 +48,7 @@ async function bootstrap() { const port = process.env.PORT || 3333; await app.startAllMicroservices(); - await app.listen(port); + await app.listen(port, '0.0.0.0'); Logger.log( `🚀 Application is running on: http://localhost:${port}/${globalPrefix}` );