Update Dockerfile

deploy static file into nginx image
This commit is contained in:
sysuid 2024-06-08 00:22:28 +08:00 committed by GitHub
parent ec2a1999ee
commit 7356d6628f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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