Skip to content

treeder/tiny-node-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is an example for how to build a teeny, tiny Docker image for your Node programs.

This example is an web server that prints Hello World and ends up in small Docker image:

1. Get dependencies

We only have one dependency, so let's get it and vendor it:

docker run --rm -v "$PWD":/app -w /app iron/node:dev npm install

2. Test it locally

docker run --rm -it -p 8080:8080 -v "$PWD":/app -w /app iron/node node server.js

Check localhost:8080 to ensure it's running.

3. Build image

docker build -t treeder/tiny-node:latest .

4. Test the image

Now that we built the image, let's run it.

docker run --rm -it -p 8080:8080 treeder/tiny-node

Surf to: http://localhost:8080/

Boom.

Fat version

To build the fat version, change all the iron/node bits to node:argon.

About

Tiny Node Docker example.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published