This gist adapts mediawiki-docker-dev for use in Structured Data on Commons project. If you spin up the app this way it lives at http://default.web.mw.localhost:8080.
Clone mediawiki
and mediawiki-docker-dev
in folders next to eachother locally.
Replace the mediawiki-docker-dev/docker-compose.yml
with the compose file attached - it includes a stock ElasticSearch image.
Edit the local.env
in mediawiki-docker-dev
as per instructions to indicate the relative location of the mediawiki codebase.
At this point, manual steps to configure extensions in the mediawiki
folder are required.
You will need a skin and extensions. Extensions are listed in order they should be set up, * indicates required for SDC*.
Extensions can be cloned down into the mediawiki/extensions
folder and installed according to (linked) instructions.
To clone via SSH use git clone ssh://[email protected]:29418/mediawiki/extensions/EXTENSION_NAME
.
Skins:
Extensions:
- Scribunto
- TemplateStyles
- CommonsMetadata
- MultimediaViewer *
- UploadWizard
- UniversalLanguageSelector*
- Elastica *
- CirrusSearch *
- Wikibase* (follow instructions for setting up repo and client)
- WikibaseCirrusSearch*
- WikibaseMediaInfo*
This gist has an in-depth guide to installing more troublesome extensions. Make sure you follow the install instructions for each extension completely.
You will have to install composer on your machine locally or else from docker.
To gather dependencies composer install
(or docker run -it --rm --user $(id -u):$(id -g) -v ~/.composer:/tmp -v $(pwd):/app docker.io/composer install --no-dev
for using docker) inside mediawiki/extensions/wikibase
as well as at the root level of mediawiki
to sure php dependencies set up properly. Reference the composer-lock.json
if you get any strange errors. It may be that you need to run composer install
commands twice - the first time to get the wikibase/composer-merge-plugin
and most of the libraries then the second time to get those dependencies which are added in by the merge plugin. You may also have to usecomposer update
to adjust anything out of sync.
mediawiki-docker-dev
imports LocalSettings.php
from the mediawiki
folder (and combines them with settings alreayd declared) Attached here are the likely changes in mediawiki/LocalSettings.php
to have the SDC setup running properly.
docker-compose exec "web"
can be used for running any arbitrary command including maintenance scripts in your mediawiki docker environment. For example,docker-compose exec "web" php /var/www/mediawiki/maintenance/update.php --wiki default --quick
./bash
allows you to shell into the docker "web" container./create
initializes spin up containers. If you want to see extended feedback, rundocker-compose up
after the containers been built to restart the container and see logs.