简体   繁体   中英

Deployment of node.js app in one step

We just finished developing a node.js application which includes a Restful API and a Mssql database .

I will need to deploy the app in in-house servers of companies having Windows 2008 and windows 2012 environments

What i want to achieve :

  • The best case is to make the deployment in an one-step procedure .

What im currently doing :

  • Clone the project in a dir

  • Run npm install ( Best case scenario is to have all dependencies in a folder to avoid problems with versions or npm )

  • Deploy the db using a script

  • Start processes with pm2 process manager

Is there anyway to pack all these steps in a simple step ? Something alternative to docker for example ? (I can't use docker because is not compatible with most of the OS )

Is there anyway to pack all these steps in a simple step ?

Yes. You can write a script that does all of that for you.

Even without writing such a script you can combine the first two steps easily. To simplify the first two steps you could make your project globaly installable with npm install --global . You could install your project that is hosted on GitHub just by doing:

npm install -g username/repo

and it will install your project and all of its dependencies.

You could also use a private package on npm or even a private npm registry for that.

You could install both the start scripts and the db deploy scripts that way as well in a single step, because your module can install multiple executables.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM