From da21e48e9d2ffb066cb3888597bf47cfa0d41418 Mon Sep 17 00:00:00 2001 From: asrient <44570278+asrient@users.noreply.github.com> Date: Sat, 18 Nov 2023 18:40:15 +0530 Subject: [PATCH] Update Dockerfile --- Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index dacbdcd..2da5098 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,15 +2,16 @@ # Build stage # ============================================================================= -FROM node:18-alpine3.18 AS builder +FROM --platform=linux/amd64 node:18-alpine3.18 AS builder LABEL authors="asrient" WORKDIR /build -# Install app dependencies +# Copy source code COPY web ./web COPY apps ./apps +# Install dependencies and build RUN cd web && npm ci && \ npm run build @@ -20,13 +21,15 @@ RUN cd apps && npm ci && \ # ============================================================================= \ # Production stage # ============================================================================= -FROM node:18-alpine3.18 +FROM --platform=linux/amd64 node:18-alpine3.18 LABEL authors="asrient" WORKDIR /app ENV NODE_ENV production +ENV PORT 5000 +# Copy source code COPY --from=builder /build/apps/bin/node ./bin/node COPY --from=builder /build/web/out ./bin/web COPY apps/package*.json ./ @@ -35,4 +38,5 @@ RUN npm ci --production EXPOSE 5000 +# Start the server CMD ["node", "bin/node/index.js"]