[英]Deploying node app using jenkins to a docker container
Using common CI/CD workflow with Jenkins and docker. 在Jenkins和docker上使用常见的CI / CD工作流程。 Deploying app to a server without external internet connection, only jenkins has external internet, so i'm building up node app: 将应用程序部署到没有外部互联网连接的服务器上,只有jenkins拥有外部互联网,因此我正在构建节点应用程序:
npm install
in a jenkins pipeline, then deploying it to a docker container. 在jenkins管道中,然后将其部署到docker容器。
Dockerfile: Dockerfile:
FROM node:12
WORKDIR /var/www/cms
COPY . .
RUN chmod +x ./strapi.sh
EXPOSE 1337
CMD ["./strapi.sh"]
After npm install
i'm copying whole directory to a docker container, that step takes approximately 15 minutes to finish up. npm install
后,我将整个目录复制到docker容器中,该步骤大约需要15分钟才能完成。 What's the best way to speed it up? 加快速度的最佳方法是什么?
you should add npm install in the docker file. 您应该在docker文件中添加npm install。
it means you will download all the packages modules inside the docker and will not need to copy them from from the outside. 这意味着您将下载docker内部的所有软件包模块,而无需从外部复制它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.