Page MenuHomePhabricator

Adding custom extensions with volumes, add php composer to image
Closed, InvalidPublic

Description

I added a volume line to docker-compose.yml that allows me to get custom extensions into the Wikibase docker, in this case the SendGrid extension:

- ./mediawiki-extensions/SendGrid:/var/www/html/extensions/SendGrid

It is now possible to get the extension files in place from the docker host machine.

However, as the case with many extensions, downloading the files and adding the extension to LocalSettings.php is not enough:

Note: You will have to run composer update in extensions/SendGrid/ folder so that composer can pick up the required SendGrid dependencies for the extension to run smoothly.

I wouldn't want to install php composer on the host machine and run it there; would it make sense for composer to be included in the Wikibase docker image probably? Perhaps it can be installed ad-hoc, but since it doesn't seem to be possible to run commands as user www-data (su won't allow it b/c of missing password and sudo ist not available at all), I wasn't able to complete the process.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

The SendGrid extension magically worked without running php composer. Closing since I am not sure what exactly composer does and how it does or doesn't affect other extensions.

I wouldn't want to install php composer on the host machine and run it there; would it make sense for composer to be included in the Wikibase docker image probably?

You can always use this https://hub.docker.com/_/composer/