restructure Dockerfile and some logic