Last Updated: March 01, 2016
· icflorescu

A better Node.js cartridge for OpenShift

Node.js on OpenShift

OpenShift Online is a hosting platform provided by RedHat that makes it easy to run container-based web applications in the cloud for free. Free, however, often comes with a cost – in this case what you're getting is an extraordinarily flexible solution, but you'll have to hack a bit in order to adapt it to your particular technical requirements.

While OpenShift does offer out-of-the-box cartridges for an impressive number of technologies and scenarios, unfortunately the "officially" provided Node.js cartridge is still at v0.10. But Node.js is – by definition – a fast-paced, always cutting-edge ecosystem, and developers are always keen to use the newest and hottest features out-there (such as Promises, async functions or other ES6/7-related stuff).

Fortunately, if you're willing to hack a bit, you can build your custom solution on top of OpenShift's basic infrastructure, and many people did so, including me.

My own "custom Node.js cartridge that *takes care of auto-updating the Node.js and NPM versions on each build*" (github/icflorescu/openshift-cartridge-nodejs) started as an afternoon project more than a year ago, because I wasn't entirely satisfied with the solutions that were available in the ecosystem in that moment. So, when I released the code on GitHub in November 2014, I never thought so many other people would be interested in using it. But that's one of the things that make writing open-source software rewarding.

Fast-forward two months ago, I was asking for feedback and community support in relation to a few further-development ideas I was having, and some wonderful people responded with GitHub issues, PRs and even private email messages.

As a result, the cartridge now offers new interesting features such as the ability to scale across multiple gears, people were able to come up with smart ideas to solve problems I had no idea how to address, and we even have a "1-click deployment" button in the project page for the really lazy developers.

Some not-so-wonderful people also responded with requests for free consultancy services, but hey, this always happens when you're publishing open-source (more about that in another article ;-).

So, thank you all (the wonderful people :-) for your feedback, and feel free to use and abuse the cartridge, continue raising issues and especially to come up with meaningful PRs in the project's GitHub page!