Refactor Dockerfile so requirements are cached

1 job for master in 7 seconds (queued for 3 seconds)