AWS Elastic Beanstalk and Composer
Composer is already installed default in Beanstalk's PHP AMI.
Also consider that container_commands are ran through '/var/app/ondeck' and not on current. Try something like this:
container_commands:
01-install-packages:
command: "composer.phar install -d /var/app/ondeck/www"
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.