Install mediawiki with docker

edit
  • Clone MediaWiki repo:
    git clone ssh://<USERNAME>@gerrit.wikimedia.org:29418/mediawiki/core.git mediawiki
    
  • Add this in docker-compose.override.yml to use mysql and expose the port to our localhost
    services:
      database:
        image: mariadb
        environment:
          MYSQL_ALLOW_EMPTY_PASSWORD: 1
        volumes:
          - ./cache/dbdata:/var/lib/mysql
        ports:
          - "3306:3306"
    volumes:
      dbdata:
        driver: local
    
    composer update --no-dev
    docker compose up
    
  • We run the following command to install and configure mediawiki. We name the database as enwiki otherwise ORES service won’t be able to find a model for a wiki name that doesn’t exist. Alternatively we could point to another service that would have such a wikiname e.g. a local running instance of ores-legacy app.
    docker compose exec mediawiki /bin/bash -c '''php maintenance/install.php --server=http://localhost:8080 --scriptpath="/w"  --dbuser root --dbserver database --dbname enwiki --lang en --skins=Vector --with-extensions --pass $MY_PASS enwiki $MY_USER'''
    

Install ORES

edit
cd mediawiki/core

git clone "https://gerrit.wikimedia.org/r/mediawiki/skins/Vector" skins/Vector

git clone "https://gerrit.wikimedia.org/r/mediawiki/extensions/ORES" extensions/ORES

Add the following code at the bottom of your LocalSettings.php:

wfLoadSkin( 'Vector' );

wfLoadExtension( 'ORES' );

Score existing revisions

edit

Score revisions and populate database tables:

docker compose exec mediawiki php extensions/ORES/maintenance/PopulateDatabase.php