Updated the handling of port to be an env var or the default.