Modularize dockerfile

Seems to work well.