Based on https://hub.docker.com/r/library/node/tags/onbuild/
Added two modules:
npm install connect serve-static
Create a file named server.js:
var connect = require('connect');
var serveStatic = require('serve-static');
connect().use(serveStatic(__dirname)).listen(8080, function(){
console.log('Server running on 8080...');
});
And run the command with this image:
docker run -it --name my-server -v $(pwd):/dev_carl -w /dev_carl -p 8080:8080 backslash112/node:v1 node server.js
And then navigate to: http://localhost:8080/main.html
Content type
Image
Digest
Size
244.6 MB
Last updated
about 10 years ago
docker pull backslash112/node:v1