# Stage 0, "build-stage", based on Node.js, to build and compile the frontendFROMnode:14asbuild-stageWORKDIR/app# 配置淘宝镜像RUN yarn config set registry https://registry.npm.taobao.org/# 复制前端依赖文件COPY package.json /app/RUN yarn installCOPY . /appRUN yarn run build# 复制 nginx 配置文件COPY default.conf default.conf# Stage 1, based on Nginx, to have only the compiled app, ready for production with NginxFROMnginx:1.18COPY --from=build-stage /app/dist/ /usr/share/nginx/html# Copy the default default.conf provided by tiangolo/node-frontendCOPY --from=build-stage /app/default.conf /etc/nginx/conf.d/default.confCMD["nginx","-g","daemon off;"]