Created
August 9, 2013 16:46
-
-
Save rmclain/6195165 to your computer and use it in GitHub Desktop.
Place this file within .ebextensions/ which should be located in the root folder on the same level as your /app and /vendor folders.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commands: | |
01updateComposer: | |
command: export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update | |
option_settings: | |
- namespace: aws:elasticbeanstalk:application:environment | |
option_name: COMPOSER_HOME | |
value: /root | |
files: | |
"/var/app/composer.json": | |
mode: "000744" | |
content: | |
{ | |
"require": { | |
"aws/aws-sdk-php": "*" | |
} | |
} | |
container_commands: | |
"1-install-composer": | |
command: "cd /var/app; curl -s http://getcomposer.org/installer | php" | |
"2-install-dependencies": | |
command: "cd /var/app; php composer.phar install" | |
"3-cleanup-composer": | |
command: "rm -Rf /var/app/composer.*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For a prod server you might want to add --optimize-autoloader as an argument to the composer install in the 2-install-dependencies coomand.
Reference: https://getcomposer.org/doc/03-cli.md
--optimize-autoloader (-o): Convert PSR-0/4 autoloading to classmap to get a faster autoloader. This is recommended especially for production, but can take a bit of time to run so it is currently not done by default.