3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00

Document how to use Composer in development.

This commit is contained in:
Michael Stenta 2020-04-30 10:32:09 -04:00
parent f62a795f85
commit 26e61b67b2

View file

@ -0,0 +1,34 @@
# Composer
The farmOS development Docker image comes pre-installed with
[Composer](https://getcomposer.org), which is used for dependency management.
## Running Composer in Docker
In order to run the `composer` command, you must use `docker exec` to run the
command inside the farmOS container.
sudo docker exec -it -e COMPOSER_MEMORY_LIMIT=-1 farmos_www_1 composer
For example, the following will run the `composer update` command:
sudo docker exec -it -e COMPOSER_MEMORY_LIMIT=-1 farmos_www_1 composer update
## Common tasks
Some common Composer tasks are documented here.
### Updating dependencies
composer update
### Adding a module
composer require drupal/[module]
This will download the module into the `web/modules/contrib` directory, and add
it to the root `composer.json` file.
If the module is being added to the farmOS installation profile itself, you
need to manually move the `require` line from the root `composer.json` to
`web/profiles/farm/composer.json` and commit it to that repository.