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 sys = require('sys')," >> app.js
RUN echo "    exec = require('child_process').exec;" >> app.js
RUN echo "" >> app.js
#begin fix
RUN echo "exec('ls', {cwd: '/'}, function(err, out, stderr) {" >> app.js # add cwd parameter
RUN echo "	console.log(out);" >> app.js
RUN echo "});" >> app.js
#end fix
CMD node app.js