On April 21st, Node.js released its latest major version with Node.js 14. Because this is an even-numbered release, it will become a Long Term Support (LTS) release in October 2020. This release brings a host of improvements and features, such as improved diagnostics, a V8 upgrade, an experimental Async Local Storage API, hardened the streams APIs, and more.
While Red Hat will release a Universal Base Image (UBI) for Node.js 14 in the coming months for Red Hat OpenShift and Red Hat Enterprise Linux, this article helps you get started today. If you're interested in more about Node.js 14's improvements and new features, check out the article listed at the end.
Let's use a sample application that is based on the official How to Dockerize a Node.js Application Nodejs.org docs. This is a simple Express.js application with a Dockerfile using the latest upstream community Node.js 14 image.
How to deploy
First, use the
oc new-app command with a Git repo that has a Dockerfile in it:
$ oc new-app https://github.com/nodeshift-starters/basic-node-app-dockerized
To access your application, you need to expose it using this simple command:
$ oc expose svc/basic-node-app-dockerized
Or, you can use the Nodeshift module to deploy a local directory. Assuming that you cloned the project we used earlier, you can run this command:
$ npx nodeshift --build.strategy=Docker --expose
As you can see, using Node.js 14 on Red Hat OpenShift today is pretty simple. To learn more about the improvements and features in Node.js 14, check out the official Node.js blog post.Last updated: June 26, 2020