Skip to content

MediaWiki Docker Image with SQLite support

Notifications You must be signed in to change notification settings

igor-vovk/tiny-mediawiki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

igor-vovk/tiny-mediawiki

Tiny MediaWiki Docker Image

Image: ghcr.io/igor-vovk/tiny-mediawiki

Project aim is to support following features:

  • SQLite support
  • use latest version of MediaWiki engine (1.39.1 at the moment)

Installation

  1. Create database, images, user-skins, user-extensions directories.
  2. Create docker-compose.yml file:
version: '3'

services:
  wiki:
    image: ghcr.io/igor-vovk/tiny-mediawiki:main
    restart: unless-stopped
    ports:
      - 8080:80
    volumes:
      - ./database:/var/www/data
      - ./images:/var/www/mediawiki/images
      - ./user-extensions:/var/www/mediawiki/user-extensions
      - ./user-skins:/var/www/mediawiki/user-skins
  1. Run docker-compose up -d
  2. Open http://localhost:8080/mw-config/index.php in your browser and follow installation instructions.
  3. Choose SQLite database and set /var/www/data as database directory. In the end of the installation, save the LocalSettings.php file and put it in the directory with your docker-compose.yml file.
  4. Add your LocalSettings.php file to the docker-compose.yml file:
...
    volumes:
      - ./database:/var/www/data
      - ./images:/var/www/mediawiki/images
      - ./user-extensions:/var/www/mediawiki/user-extensions
      - ./user-skins:/var/www/mediawiki/user-skins
      - ./LocalSettings.php:/var/www/mediawiki/LocalSettings.php
  1. Run docker-compose up -d again. You are good to go!

Attaching extensions and skins

This image supports attaching extensions and skins via volumes. To attach extensions and skins, symlink them to /var/www/mediawiki/user-extensions and /var/www/mediawiki/user-skins respectively:

services:
  wiki:
    image: ghcr.io/igor-vovk/tiny-mediawiki:main
    restart: unless-stopped
    volumes:
      - ./user-extensions:/var/www/mediawiki/user-extensions
      - ./user-skins:/var/www/mediawiki/user-skins

...

Note: after making changes to extensions or skins, you need to run docker-compose up -d again, because they are linked during the startup.

Sitemap generation

This image relies on external scheduler to trigger sitemap generation. The image provides /mwsitemapgen.sh script to trigger the generation.

See this docker-compose.yml example, which uses Ofelia scheduler:

version: '3'

services:
  ofelia:
    image: mcuadros/ofelia:latest
    restart: unless-stopped
    command: daemon --docker
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    depends_on:
      - wiki
  wiki:
    image: ghcr.io/igor-vovk/tiny-mediawiki:main
    restart: unless-stopped
    volumes:
      ...
      - sitemap:/var/www/mediawiki/sitemap
    labels:
      - ofelia.enabled=true
      - ofelia.job-exec.sitemap.schedule=@every 1h
      - ofelia.job-exec.sitemap.command=/mwsitemapgen.sh --server https://example.com --identifier examplecom

volumes:
  sitemap:

Error accessing SQLite database / uploading images

Probably attached folders are not writable by the www-data user. To fix this, you need to change the owner of the folders:

sudo chown -R www-data:www-data ./database ./images

About

MediaWiki Docker Image with SQLite support

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages