加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 468 Bytes
一键复制 编辑 原始数据 按行查看 历史
Vinlic 提交于 2024-04-11 13:54 . npm切换到yarn,加快容器构建
FROM node:lts AS BUILD_IMAGE
WORKDIR /app
COPY . /app
RUN yarn install --registry https://registry.npmmirror.com/ && yarn run build
FROM node:lts-alpine
COPY --from=BUILD_IMAGE /app/public /app/public
COPY --from=BUILD_IMAGE /app/configs /app/configs
COPY --from=BUILD_IMAGE /app/package.json /app/package.json
COPY --from=BUILD_IMAGE /app/dist /app/dist
COPY --from=BUILD_IMAGE /app/node_modules /app/node_modules
WORKDIR /app
EXPOSE 8000
CMD ["npm", "start"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化