Skip to content

Instantly share code, notes, and snippets.

@etiennemarais
Last active September 27, 2017 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etiennemarais/de018d83c242d5abc4bb64a8e41ffd60 to your computer and use it in GitHub Desktop.
Save etiennemarais/de018d83c242d5abc4bb64a8e41ffd60 to your computer and use it in GitHub Desktop.
Notes about advanced composer
COMPOSER_TIMEOUT=600 php -d memory_limit=2G path/to/composer.phar $@
# composer_wrapper.sh
php -d memory_limit=2G /path/to/composer.phar $@
alias composer='path/to/composer_wrapper.sh'
1. Checkout just the composer.* files to the docker build dir
2. Run docker build
1. Copy just the composer.* files into the build image
2. Run composer install with flags
3. Copy in source files
4. Run composer dump-autoload --optimize
# Super GH speed
--prefer-dist
# Small deployment, ignores dev packages
--no-dev
# Power
--optimize-autoloader or dump-autoload --optimize
# Github rate limits api calls
composer config -g github-oauth.github.com <token>
# Create token at https://github.com/settings/tokens
# They fixed it in 1.3.0
composer self-update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment