Wikibase/Docker/fr

Vue d'ensemble


Ceci est un guide pas à pas pour installer la suite Wikibase sur votre propre ordinateur en utilisant Docker.

Nos images Docker contiennent une installation complète de MediaWiki et de Wikibase, et le processus d'installation est paramétrable en fonction de vos besoins.



Préparer votre environnement
Terminez toutes ces étapes avant de commencer l'installation de Wikibase.



Installer Docker
On the computer where you want to run Wikibase, first install Docker.

If you need help installing beyond Docker's own instructions, you can consult these third-party tutorials for Linux, Mac and Windows.



Vérifier les fichiers
Check out the Wikibase pipeline repository from GitHub to obtain the example configuration files. The latest release is, so run the following commands:

git clone https://github.com/wmde/wikibase-release-pipeline cd wikibase-release-pipeline git checkout tags/wmde.11



Préparer vos fichiers
Create a new launch directory from which you will launch Docker. Bear in mind the name of that directory will appear in your Docker container names. For this example we will create the directory "wbdocker".

mkdir $HOME/wbdocker cp -r example/* $HOME/wbdocker cd $HOME/wbdocker mv template.env .env



Personnaliser votre environnement
The  file contains the environment variables that govern your Wikibase installation. You will need to edit this file and change the information on specific lines as follows:



Configuration de MediaWiki

 * MW_ADMIN_NAME
 * MW_ADMIN_PASS
 * MW_ADMIN_EMAIL

These values define the username, password and email address of the administrative user in your new MediaWiki installation. Vous utiliserez ce nom d'utilisateur et le mot de passe, pour vous connecter dans l'interface web de votre nouvelle instance pour la première fois; l'adresse courriel que vous donnez vous permettra de remettre à jour votre mot de passe si nécessaire.



Cette clé secrète doit être unique; MediaWiki l'utilise à différentes fins (comme la gestion des sessions, la source du repli de l'entropie cryptographique). Suivre le lien pour les informations complémentaires. To generate a random string for use in this file:

echo -n "MW_SECRET_KEY=" tr -dc 'A-Za-z0-9@#%^+_-' 

Configuration de la base de données

 * DB_NAME
 * DB_USER
 * DB_PASS

These values control the name of the database that MediaWiki will use, as well as the database username and password. At the bare minimum, change :

echo -n "DB_PASS=" tr -dc 'A-Za-z0-9@#%^+_-' 

Configuration de Wikibase

 * WIKIBASE_PINGBACK=false

Par défaut la fonctionnalité du ping sur Wikibase est désactivée. Please consider enabling this feature (which sends only anonymized data) by changing  to.

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.

Paramètres host








Ces lignes définissent le nom de l'hôte et le port de votre Wikibase (ce que vous devez mettre dans la barre d'adresse de votre navigateur) et, de manière facultative, ceux des services externes pour une installation étendue.

Sandbox users (those who want only a locally accessible setup on a single computer) can and should leave this section untouched.

However, if you plan to use any of the above external services outside of a self-contained Docker setup, you need to set,  ,   and/or   to publicly accessible hostnames -- that is, hostnames that can be resolved in DNS -- or IP addresses. The latter might be the right choice if you're running this on a local network.

MAX_JOBS
You can specify that the job runner should run more jobs between restarts by setting  higher than its default value of 1. See below for more information on the job runner.



Installer et exécuter Wikibase
Now that you've installed all the needed software and customized your environment file, you have one more choice: whether to perform a minimal install (just MediaWiki, a backing MySQL database and Wikibase) or an extended install (MediaWiki, database, Wikibase, WDQS, Elasticsearch, QuickStatements).



Installation minimale
For a minimal install, in the launch directory where you copied and modified your files, simply run:

docker compose up -d



Installation étendue
For an extended install, in the launch directory where you copied and modified your files, run this extended command:

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

Options
If you need to run multiple job runners, you can add the following option (with X being the number of job runners to run) onto your  command, as in this example:

docker compose up -d --scale wikibase_jobrunner=X



Démarrage et utilisation
You will now have at least two Docker containers running. To see your running containers, run. The following example output is from an extended install:

$ docker compose ps NAME                        COMMAND                   SERVICE              STATUS              PORTS wbdocker-elasticsearch-1       "/usr/local/bin/dock…"    elasticsearch        running             9300/tcp wbdocker-mysql-1               "docker-entrypoint.s…"    mysql                running             3306/tcp wbdocker-quickstatements-1     "/bin/bash /entrypoi…"    quickstatements      running             0.0.0.0:8840->80/tcp, :::8840->80/tcp wbdocker-wdqs-1                "/entrypoint.sh /run…"    wdqs                 running             9999/tcp wbdocker-wdqs-frontend-1       "/entrypoint.sh ngin…"    wdqs-frontend        running             0.0.0.0:8834->80/tcp, :::8834->80/tcp wbdocker-wdqs-proxy-1          "/bin/sh -c \"/entryp…"   wdqs-proxy           running             80/tcp wbdocker-wdqs-updater-1         "/entrypoint.sh /run…"    wdqs-updater         running             wbdocker-wikibase-1             "/bin/bash /entrypoi…"    wikibase             running             0.0.0.0:80->80/tcp, :::80->80/tcp wbdocker-wikibase_jobrunner-1   "/bin/bash /jobrunne…"    wikibase_jobrunner   running             80/tcp



For some more helpful Wikibase-oriented Docker commands, check out the Docker tooling section of our maintenance documentation.

Log into your new Wikibase by navigating to your local machine's web server.



Gestionnaire des tâches
The example  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.

Si vous exécutez des lots importants de modifications, ce lanceur de travaux pourra éventuellement échouer dans les mises à jour. You can speed it up by increasing the MAX_JOBS variable in your  file (see above), in order to run more jobs between restarts. This change won't take effect in the job runner until you restart your  project.

If you wish, you can also run several job runners in parallel by adding the option  to the   command. See the Installing section above.

Liens de sites
To create links between MediaWiki and Wikibase, run the add site script. You can learn more about adding sitelinks on the Wikidata sitelinks help page and the Wikibase advanced configuration page.



Utiliser votre nouvelle instance
Une fois tous les services démarrés, vous pouvez commencer à remplir, étendre et personnaliser votre instance vide de Wikibase. Take a look at our setup resources page to get started.



Lectures complémentaires

 * DigitalOcean's tutorial on docker-compose for Linux
 * Microsoft's tutorial on Docker for Windows
 * The Wikibase Docker release workboard on Phabricator