I have an application with Composer dependencies which I want to deploy to an Elastic Beanstalk container. However my composer.json file is not in the project root folder.
Just a note, most of the PHP containers that AWS is using in Elastic Beanstalk are auto deploying by running composer.phar install now. You should be able to skip this step if you don't have a "vendors" folder present. If you want to run it manually, the above methods should work, but you should only need something like @kewubenduben mentioned.
If you are trying to access a private remote repository, check out the Q and A here: AWS Elastic Beanstalk using PHP with Private Composer Repositories , shameless plug.