Kubernetes/Docker/Dockerfile/Nginx/Dockerfile-node

17 lines
281 B
Plaintext
Raw Normal View History

2024-08-07 10:54:39 +00:00
# 多阶段构建
FROM node:14 as build
COPY . /app
WORKDIR /app
RUN npm config set registry https://registry.npmmirror.com \
&& npm install \
&& npm run build:prod
FROM nginx:alpine
COPY --from=build /app/dist /app/www
COPY ./web.conf /etc/nginx/conf.d/default.conf