docker-wikifarm uses docker compose to build and manage MediaWiki wiki farms. It optionally supports multiple MediaWiki versions side by side. The wiki farms run in two (or more) docker containers: one for the database and one for each MediaWiki version (including the web server and MediaWiki). The MediaWiki containers build upon the official MediaWiki Docker images, if an appropriate image exists for the desired version, at https://hub.docker.com/_/mediawiki.
The repo has the following directories:
This directory contains the scripts used to build and manage the wiki farm. They include:
build_wikifarm.sh
: build the wiki farm containers for one MediaWiki version (1.31, 1.32, 1.33, 1.34, or master)build_all.sh
: build the wiki farm containers for all supported MediaWiki versionscreate_wiki.sh
: create a wiki on the wiki farmmk-favicon.sh
: creates afavicon.ico
file from thelogo.png
file for a wikimove_wiki.sh
: move a wiki from one wiki farm container to anotherbackup_wiki_database.sh
: create a SQL dump of a wiki involumes/backups
disable_wiki
: disable a wiki on a wiki farm (this does not remove the database)run_update.sh
: run the update maintenance script on one wikipatch_master.sh
: applies a gerrit patch to wikifarm-master and runs updatestatus.sh
: list all images and containersclean_all.sh
: remove all images and containers generated from the build and prune unused containersclean.sh
: remove only the database and wikifarm images and containers and prune unused containerswiki_shell.sh
: open a bash command prompt on a wiki farmdatabase_shell.sh
: open a MySQL shell on the database host
This directory contains files that can be edited before the wiki farm is built to specify the configuration. Currently there is a single config file:
variables.env
: environment variables that will be used in the containers
This directory contains volumes that are shared between the host and the wiki farm container. They include:
instances
: instance files for the wikis, including per wiki configuration, branding (i.e. logo and favicon), and imagesbackups
: wiki SQL dumps created by thebackup_wiki_database.sh
scriptmediawiki
: wiki configuration per MediaWiki version
The mediawiki
directory listed above will contain one directory for each
MediaWiki version that has been built. Those subdirectories will in turn each
contain the following subdirectories:
config
: MediaWiki configuration files, includingConfig.php
, which contains basic configuration for the wiki farm and can be edited to tweak the wiki farm configuration. In addition, WikiFarmExtensions.php and WikiFarmSkins.php can be edited to enable extensions and skins for all wikis on the wiki farm.extensions
: the extensions directory containing the downloaded code of the installed extensionsskins
: the skins directory containing the downloaded code of the installed skins
This directory contains the files that are necessary to build the wiki farm container.
To build the wiki farm, do the following:
- Edit the files in the
config
directory at the top level of the repository. Especially change the passwords inconfig/variables.env
. - Run the
build_wikifarm.sh
script that is in the scripts directory. It takes two parameters: the MediaWiki version (i.e. 1.31, 1.32, 1.33, 1.34, or master) and the host port to use to communicate with the wiki farm web server.
To add a new wiki to the wiki farm, do the following:
- Run the
create_wiki.sh
script from the scripts directory. It takes two parameters: the MediaWiki version of the wiki farm (i.e. 1.31, 1.32, 1.33, 1.34, or master) and the name of the wiki. (Note that if you have just built the wiki farm, you will need to wait a few minutes to let the database come up before creating a wiki.) - Copy the logo file (
logo.png
) into the instance branding directory atvolumes/instances/<wiki name>/branding
. - Copy your favicon file (
favicon.ico
) into the instance branding directory atvolumes/instances/<wiki name>/branding
or use themk-favicon.sh
script to generate afavicon.ico
file from yourlogo.png
file. The latter takes two parameters: the name of the wiki and the MediaWiki version of the wiki farm. - Create a
LocalSettings.php
file in thevolumes/instances/<wiki name>
directory to configure the wiki instance. The instanceLocalSettings.php
file will be called from the end of the wiki farmLocalSettings.php
file. The content of the latter file can be examined at 'wikifarm/files/LocalSettings_wikifarm.php`.