I think using docker compose could simplify your setup quite a bit, removing the need for many of the shell scripts: https://docs.docker.com/compose/