Posted by & filed under Docker.

MediaWiki Docker container with VisualEditor Plugin and Parsoid Service

mediawikiI recently moved my server infrastructure to Docker and had to port a MediaWiki setup with the VisualEditor plugin and its dependant Parsoid service. It was already time consuming to get these three working in a classic setup and i found no existing Docker image(s) that were satisfying. So i decided to create my own.

The image is based on the offical PHP7 images and is running a Nginx webserver and PHP-FPM. There will be three master processes (Nginx, PHP-FPM, Parsoid) running in the container that are controlled by supervisord.

You can easily start a full featured MediaWiki instance on a Docker host with the following commands.

Start a MySQL container. If you don’t have one running already:

docker run --name=some-mysql \
-e MYSQL_DATABASE=wikidb \
-e MYSQL_USER=wikiuser \
-e MYSQL_PASSWORD=mysecret \
-e MYSQL_RANDOM_ROOT_PASSWORD=1 \
-v /srv/mediawiki/mysql:/var/lib/mysql \
-d mysql:5.7

Start MediaWiki container:

docker run --name some-wiki \
--link some-mysql:mysql \
-p 8080:80 \
-e MEDIAWIKI_SERVER=http://localhost:8080 \
-e MEDIAWIKI_SITENAME=MyWiki \
-e MEDIAWIKI_LANGUAGE_CODE=en \
-e MEDIAWIKI_DB_TYPE=mysql \
-e MEDIAWIKI_DB_HOST=some-mysql \
-e MEDIAWIKI_DB_PORT=3306 \
-e MEDIAWIKI_DB_NAME=wikidb \
-e MEDIAWIKI_DB_USER=wikiuser \
-e MEDIAWIKI_DB_PASSWORD=mysecret \
-e MEDIAWIKI_ENABLE_UPLOADS=1 \
-v /srv/mediawiki/images:/images \
-d kristophjunge/mediawiki

Create a new database by using the install script. Insert username and password for your admin account.

$ docker exec -i -t some-wiki /script/install.sh <username> <password>

Leave a Reply

  • (will not be published)