Nodejs test / demo server application
Example from howtonode.org/hello-node
git clone [email protected]:bahmutov/hello-world.git
cd hello-world
npm install
npm start
From another terminal execute one of the following
curl localhost:1337
http localhost:1337
You should see Hello World
message
For example, you can use this project to try the Dokku platform
In order to show how to build smaller Docker image, while still testing this app, see the three Docker files
- Dockerfile-simple
- Dockerfile with multi-stage feature
- Dockerfile-bare based on the smallest Node images without NPM
The images built from these files show the space savings
$ docker images gleb/hello-world
REPOSITORY TAG IMAGE ID CREATED SIZE
gleb/hello-world bare 78cdddcd77ac 23 seconds ago 37.9MB
gleb/hello-world multi-stage 44dcd42b11f4 17 minutes ago 49.4MB
gleb/hello-world simple aed28e2bde45 31 minutes ago 202MB
Read blog post Making small Docker image for more details.
Author: Gleb Bahmutov <[email protected]> © 2016
License: MIT - do anything with the code, but don't blame me if it does not work.
Support: if you find any problems with this module, email / tweet / open issue on Github
Copyright (c) 2016 Gleb Bahmutov <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.