FROM node:6.9.5

RUN mkdir question && cd question

## installing express
RUN npm install express --save

## moving to source dir
WORKDIR question

## generating new "app.js" file from scratch
RUN echo "var express = require('express');" >> app.js
RUN echo "var app = express();" >> app.js
RUN echo "app.get('/', function (req, res) {" >> app.js
RUN echo "res.send('Hello World!');" >> app.js
RUN echo "});" >> app.js
RUN echo "app.listen(8080);" >> app.js

EXPOSE 8080
CMD node app.js