8000 GitHub - dhutty/nodexample: A tiny example Node.js application server, containerized · GitHub
[go: up one dir, main page]

Skip to content

About

A tiny example Node.js application server, containerized

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

A tiny example Node.js application server, containerized

Technologies

Node.js is a JavaScript runtime environment, effectively a way to run JavaScript without a browser, such as for creating a web application server that can serve HTTP clients.

Express is a web framework for Node.js, an approach that makes it easier to write web applications by providing a body of common code.

Using a Container-based approach that facilitates reproducible, isolated application deployment.

With Docker and Docker Compose we can deploy and manage container-based Node.js applications.

How to build and run this example application server

Assuming you have a unix-like machine available such as linux or macos, this is all quite straightforward. I’m going to assume a linux machine running Ubuntu and that Homebrew is available to keep the length of this to a minimum.

Clone this repository

git clone https://github.com/dhutty/nodexample.git && cd nodexample

Install software

docker and docker-compose can be installed either:

  • by the OS package manager: sudo apt install docker docker-compose

  • by Homebrew: brew install docker docker-compose

Build & Run

docker build . --tag dhutty/node-web-app
docker compose up --detach
curl -i http://localhost:8080

which should give you output that looks somewhat like:

HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: text/html; charset=utf-8
Content-Length: 11
ETag: W/"b-Ck1VqNd45QIvq3AZd8XYQLvEhtA"
Date: Fri, 09 Dec 2022 00:09:57 GMT
Connection: keep-alive
Keep-Alive: timeout=5

Hello World

Next steps and References

About

A tiny example Node.js application server, containerized

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages

0