Restructure layers of Dockerfile