Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daliborgogic/micro-node-docker
https://github.com/daliborgogic/micro-node-docker
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/daliborgogic/micro-node-docker
- Owner: daliborgogic
- Created: 2016-06-17T14:14:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-16T09:49:17.000Z (almost 8 years ago)
- Last Synced: 2024-10-17T19:19:30.633Z (27 days ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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:
[![](https://badge-imagelayers.iron.io/treeder/tiny-node:latest.svg)](https://imagelayers.iron.io/?images=treeder/static-go:latest 'Get your own badge on imagelayers.io')
## 1. Get dependencies
We only have one dependency, so let's get it and vendor it:
```sh
docker run --rm -v "$PWD":/app -w /app iron/node:dev npm install
```## 2. Test it locally
```sh
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
```sh
docker build -t treeder/tiny-node:latest .
```## 4. Test the image
Now that we built the image, let's run it.
```sh
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.