Docker has a built in feature for this, so figure out how to use it. Also handle the logs for the VM, not just the containers.