Node.js

In this lesson, you will be provided with the basic application image for Node.js.

We'll cover the following

Files#

You can find these files in the code/common-development-profiles/demos/nodejs folder.

A static HTML file to be served:

www/index.htm



Define and run an HTTP server, a static files server and a REST API:

index.js



List dependencies that will need to be restored during the build:

package.json



Docker image definition:

Dockerfile


Result#

Run the following program to display the output of the node application using a docker file.

/
Dockerfile
Your app can be found at: https://811lgmnxmw1xy.educative.run

The resulting image is published as learnbook/node-server. You can run a local container from it with the following command:

Then point your browser to http://localhost:8087


Let’s look at another image in the next lesson.

Java
PHP
Mark as Completed
Report an Issue