简体   繁体   English

使用jenkins将节点应用程序部署到Docker容器

[英]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.

相关问题 Docker 容器以代码 2 退出,并通过 Gitlab CI/CD 管道将节点应用程序部署到 Digital Ocean - Docker container exits with code 2 with deploying node app to Digital Ocean via Gitlab CI/CD pipeline 如何在 aws ec2 中使用 jenkins docker 容器设置部署 nodejs 应用程序 - How to setup deploy nodejs app using jenkins docker container in aws ec2 如何使用 docker-composer 运行 node js docker 容器来管理 php 应用程序资产 - How to run node js docker container using docker-composer to manage php app assets 与Docker一起部署Node.js Web应用程序 - Deploying node.js web app along with docker 从 docker 容器和节点使用 websockets 的问题 - Problem using websockets from docker container and node 无法使用 node:alpine 在 Docker 容器中运行 React 应用程序的开发版本 - Unable to run a development build of a React app in a Docker container using node:alpine 使用 docker 构建 Node-js 生产环境并实时部署应用程序 - Node-js production build using docker and deploying application live 使用 docker-compose 的 docker 容器中的节点检查器 - Node-inspector in docker container using docker-compose 在 IIS 中部署 Node App - Deploying Node App in IIS 从Docker容器中的Node应用访问主机上的PostgreSQL服务 - Accessing PostgreSQL service on host from Node app in Docker container
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM