From b3a74f3d88f5fcb4645af9cc88fbfd47cea910ce Mon Sep 17 00:00:00 2001 From: amirzenoozi Date: Fri, 22 Dec 2023 19:05:33 +0100 Subject: [PATCH] :green_heart: Feat: Deploy Build Folder --- Dockerfile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 72f9c40..34600ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,16 +7,23 @@ FROM node:18-alpine WORKDIR /app # Copy the package.json file. -COPY package.json . +COPY package.json yarn.lock ./ # Install application dependencies. -RUN yarn install +RUN yarn install --production -# Copy the rest of the application files. +# Install serve node package. +RUN yarn global add serve + +# Bundle app source COPY . . +# Build the application. +RUN yarn build + # Expose the port. EXPOSE 3000 # Run the application. -CMD ["yarn", "start"] +CMD ["serve", "-s", "build", "-l", "3000"] +