I've solved my problem. The solution was simply to remove the /vendor folder from the .gitignore list, run composer update locally, and upload everything to the repository. There was no need to move the index.php out of the /public folder.
/vendor
.gitignore
composer update
index.php
/public