Miguel Stevens
Miguel Stevens

Reputation: 9191

Install via Composer or copy vendor folder

I'm wondering, when deploying composer-based projects why most people advice to SSH into the server and install composer and download the dependancies as following:

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
composer install

I don't see the difference from just copying the /vendor folder when you deploy. Do I miss anything?

Using GIT

When using GIT I can imagine that the /vendor folder is large and should be avoided. Is this the main reason?

Upvotes: 3

Views: 2318

Answers (1)

Wouter J
Wouter J

Reputation: 41934

  • composer install will install the dev dependencies, which is not something you want on your server. Because of that, you use composer install --no-dev on your server.

    This will reduce the amount of files on the server.

  • Some packages might use scripts which set an absolute path somewhere, this can break up badly when not changing.
  • Packages are quite large to ship using FTP

Upvotes: 3

Related Questions