Dockerfile refactor

@patocox I was trying to use this as a base but ran into some problems trying to start the container (I think because my base image needed to change the WORKDIR to install some stuff but then the current directory wasn't in the right directory to run `node app.js` when the container started).

This PR fixes the WORKDIR issue and refactors some of the other stuff as well.