Skip to content

luridarmawan/node-docker

Repository files navigation

Nodejs Dockerfile

Nodejs Docker

A minimal Dockerfile based on lates stable Node.js with Git installed.

What's included

  • NVM v0.39.1
  • latest stable node
  • yarn and npm
  • Git

USAGE:

docker run -it --rm --name node -v "$PWD":/projects luri/node

luri/node

Example

See folder "examples". There is an example of using this simple docker in a node js application.

You can build and run with:

docker build . -t example
# then
docker run -it --rm --name node example

If you want to use docker-compose, then

docker-compose up --build

docker compose

Testing

 curl "http://localhost:3000/api/test" -s -H "Content-Type: application/json" -d '{"name":"my name"}'

Result:

{"code":0,"body":{"name":"my name"},"text":"POST success"}

Resource


Built by (c) Luri Darmawan and contributors. Released under the MIT license.

Releases

No releases published

Packages

No packages published