From cf0e4550070f9b12158428dfde9a22206fe96f9f Mon Sep 17 00:00:00 2001 From: sysuid <22698877+sysuid@users.noreply.github.com> Date: Sat, 8 Jun 2024 00:22:28 +0800 Subject: [PATCH] Update Dockerfile deploy static file into nginx image --- Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6e07a1a..803708a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:22 +FROM node:22 AS build-yarn WORKDIR /app @@ -8,6 +8,10 @@ RUN yarn install COPY . . -EXPOSE 5173 +RUN yarn build -CMD ["yarn", "dev", "--host", "0.0.0.0"] +FROM nginx:latest AS runtime + +COPY dist/ /usr/share/nginx/html/ + +EXPOSE 80