Wikibase/Docker

From mediawiki.org
Jump to navigation Jump to search
This document covers installing the Docker images for Wikibase. For manual installation instructions for the Wikibase suite, see Wikibase/Suite. For installing just the Wikibase extension, see Wikibase/Installation.

Installing Wikibase with Docker[edit]

The Wikibase team is now regularly releasing Docker images with MediaWiki, Wikibase and associated services. With a little customization, you can install exactly the kind of Wikibase instance you need.

The MediaWiki extensions included in this install are listed here.
Issues and Roadmap can be seen on the Phabricator workboard here.

Before you start[edit]

  • You’ll need to have docker and docker-compose installed on the computer where you want to run your Wikibase instance. (For help with this step, consult the resources list at the bottom of the page.)
  • The Wikibase team recommends providing at least 8GiB of RAM for a complete Docker install including all services.

Preparing your environment[edit]

Examine the files in the example directory of the wikibase-release-pipeline repository.

You'll need a docker-compose.yml file much like the one provided in the example directory, as well as an optional docker-compose.extra.yml (see below for context). You'll also need a .env file.

Look at the contents of the template.env file, and use the contents to create your own .env. You will need to populate the following sections with the secure usernames and passwords of your choice.

Mediawiki Configuration[edit]

  • MW_ADMIN_NAME
  • MW_ADMIN_PASS
  • MW_ADMIN_EMAIL

These values will be deployed into your MediaWiki installation. You'll use this username and password to log into the web interface of your new instance for the first time; the email address you enter here also serves as your password recovery channel.

This secret key should be unique; MediaWiki uses it for several purposes (e.g., session management, fallback cryptographic entropy source). See the link for more information.

Database Configuration[edit]

  • DB_NAME
  • DB_USER
  • DB_PASS

The database name, user and password you specify here will be deployed into your installation.

Wikibase Configuration[edit]

By default, the Wikibase pingback feature is disabled. Please consider enabling this feature (which sends only anonymized data) by changing false to true.

Enabling this feature significantly improves Wikimedia Deutschland's insight into how Wikibase is being used and helps us make more informed decisions regarding the development roadmap. For more information, read our pingback documentation topic.

  • WIKIBASE_HOST=localhost
  • WIKIBASE_PORT=80

These define the public host name and port of your Wikibase (what you would put in your browser’s address bar). If you’re using QuickStatements (see below), the same host and port must also be reachable from within the QuickStatements container, which means it can’t be localhost (since that would refer to the QuickStatements container); if you want to run a local Wikibase with QuickStatements, you can try using a private IP address (e.g. 192.168.0.x) as a local yet non-localhost host name. Docker Desktop for Mac does not allow specifying service host IP, (e.g. per-container IP addressing is not possible) yet it is possible to instead (for your Mac system only) use host.docker.internal

Files[edit]

Place your new .env file next to your docker-compose.yml file (and optionally your docker-compose.extra.yml) in a folder of your choice.

Bear in mind that the name of this folder is used in the Docker container names.

Minimal install[edit]

At this stage, you have what you need to install MediaWiki (running on port 80) with Wikibase and a MySQL (MariaDB) backing database.

In the folder where you placed docker-compose.yml as mentioned above, simply run:

docker-compose up -d

Extended install[edit]

You may also wish to run additional services like the query service (WDQS), QuickStatements (see here for more information) and Elasticsearch.

To run these additional services we need to bring the containers up and specify both configurations by running:

docker-compose -f docker-compose.yml -f docker-compose.extra.yml up -d

Notes[edit]

Both install processes end up launching two Docker containers:

  • {folder-name}_wikibase_1
  • {folder-name}_mysql_1.

The example invocations of docker-compose use the -d flag to start the containers in the background. You can omit this flag to run in the foreground, or, if you simply wish to view the continuous output, you can subsequently run docker-compose logs -f.

Job runner[edit]

The example docker-compose.yml sets up a dedicated job runner which restarts itself after every job, to ensure that changes to the configuration are picked up as quickly as possible.

If you run large batches of edits, this job runner may not be able to keep up with edits. You can speed it up by increasing the MAX_JOBS variable in your .env file, to run more jobs between restarts, if you’re okay with configuration changes not taking effect in the job runner immediately.

Alternatively, you can run several job runners in parallel by adding an option like --scale wikibase_jobrunner=8 to the docker-compose up command.

After install[edit]

1. Verify that all the services have started: run docker-compose ps. You should see something like this:

       Name                    Command             State         Ports       
-----------------------------------------------------------------------------
example_mysql_1      docker-entrypoint.sh mysqld   Up      3306/tcp          
example_wikibase_1   /bin/bash /entrypoint.sh      Up      0.0.0.0:80->80/tcp

2. Log into your local machine.

3. You may check the logs for success, further information or errors using this command: docker-compose logs --tail=20 -t

If you like to create links between MediaWiki and Wikibase make sure to run the add site script. Otherwise, you will see error messages like "The provided site identifier was not recognized".

For more detailed information, check out the README in the examples section of the wikibase-release-pipeline repository.

Using your new instance[edit]

Once all the services have started, you can begin the exciting process of filling up, extending and customizing your empty instance of Wikibase. Take a look at our setup resources page to get started.

Further reading[edit]