I am writing a nodejs application with Angular as my front end. For this I am having Git as my code management server. For client, I am doing minification and it is ready for production.
But I am not sure, how to prepare server side files for production. Do we need to just copy all the Git folders into production server?. Let me know the best way to deploy nodejs server application.
node_modules
in the repo, cause different machines have different setups/installations, you cannot tell if one package would work before you run it unless younpm install
them.Docker
, use it, pre-bundle all (includenode_modules
) files into the docker image, and you do not needpm2
here,Docker
itself can restart automatically. This is the ideal approach.