From 693dc16c8436a333044ad38e41cf89ff6c8648d0 Mon Sep 17 00:00:00 2001 From: gimse <23360355+gimse@users.noreply.github.com> Date: Thu, 9 Nov 2023 19:22:09 +0100 Subject: [PATCH] working with nginx on port 8080 --- Dockerfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index fe62d98..af636c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use node:alpine3.17 image as the base image -FROM docker.io/node:alpine3.17 +FROM docker.io/node:alpine3.17 as builder # Maintainer information MAINTAINER tanwenyang@aliyun.com @@ -16,5 +16,11 @@ WORKDIR /app # Set the Yarn registry to Taobao mirror and install dependencies using yarn install RUN yarn config set registry 'https://registry.npm.taobao.org' && yarn install && yarn cache clean -# Run the command to start the container, which will run the project in development mode and listen on port 5173 of address 0.0.0.0 -CMD yarn dev --host 0.0.0.0 +# Building the html code +RUN yarn build + +# Using nginx for production +FROM docker.io/nginxinc/nginx-unprivileged:1.25.1-alpine + +# Copy html from previous stage +COPY --from=builder /app/dist /usr/share/nginx/html