You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
662 B
20 lines
662 B
FROM node:18-alpine as build-stage
|
|
WORKDIR /app
|
|
COPY . ./
|
|
ENV NODE_OPTIONS=--max-old-space-size=16384
|
|
RUN npm install pnpm -g
|
|
# 切换淘宝镜像源
|
|
# RUN npm config set registry https://registry.npmmirror.com/
|
|
# RUN pnpm config set registry https://registry.npmmirror.com/
|
|
RUN pnpm i
|
|
RUN npm run build
|
|
|
|
|
|
FROM nginx:1.17.3-alpine as production-stage
|
|
COPY --from=build-stage app/_nginx/nginx.conf /etc/nginx/nginx.conf
|
|
COPY --from=build-stage app/_nginx/env.js /etc/nginx/env.js
|
|
COPY --from=build-stage app/_nginx/default.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=build-stage app/dist/ /usr/share/nginx/html
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|
|
|