MediaWiki-Docker/Extension/SyntaxHighlight

Download the SyntaxHighlight extension into extensions/ and enable it the usual way in LocalSettings.php:

wfLoadExtension( 'SyntaxHighlight_GeSHi' );

You will also need to customize the base MediaWiki image as described in Configuration_recipes/Customize_base_image to install the python3 package, which is relied upon by the extension to perform the syntax highlighting.

In the MediaWiki root directory, create a file called python3.dockerfile, with the following contents:

FROM docker-registry.wikimedia.org/dev/buster-php72-fpm:2.0.0
RUN apt-get update && apt-get install -y python3

Then update docker-compose.override.yml to use this dockerfile when building the image for the mediawiki service:

services:
  mediawiki:
    build:
      context: .
      dockerfile: python3.dockerfile

Finally, rebuild the mediawiki service and restart docker:

docker compose build
docker compose down
docker compose up -d