Docker NodeJs

# use an existing docker image
FROM node:alpine


# dowload & install dependency
COPY ./ ./
RUN npm install


# Tell the image what to do when it starts
CMD ["npm", "start"] 

package.json

{
  "dependencies": {
      "express": "*"
	},
	"scripts": {
	   "start": "node index.js"
	}
}

index.js

const express = require('express');

const app = express();

app.get('/', (req, res) => {
	res.send('Hi there');
});

app.listen(8080, () => {
	console.log('Listening on 8080');
});