Docker image for mwlib (MediaWiki library) with WikiTeq-specific patches and configurations.
mwlib is a Python library designed for parsing MediaWiki articles and converting them into various output formats, such as PDF. It powers Wikipedia's "Print/export" feature, enabling users to generate PDF documents from Wikipedia articles and other MediaWiki-based wikis.
This Docker image provides a containerized environment for running mwlib services, including:
- nserve: MediaWiki rendering server
- mw-qserve: Queue server for rendering tasks
- nslave: Worker process for rendering operations
The image is based on Python 2.7.18 and includes various patches and fixes for compatibility with modern dependencies.
- Python 2.7.18 runtime environment
- mwlib 0.16.2 with related packages (qserve, mwlib.rl, pyfribidi, Pillow)
- Support for large request bodies via configurable
BOTTLE_MEMFILE_MAX - Pillow/ReportLab compatibility fixes
- Extended PNG decompression limits
- Multi-language font support (Arabic, Chinese, Thai, Hindi, and many others)
docker build -t docker-wikiteq-mwlib .docker run -d \
-p 8899:8899 \
-v mwlib-cache:/var/cache/mwlib \
docker-wikiteq-mwlibThe container supports the following environment variables:
BOTTLE_MEMFILE_MAX: Maximum size for request bodies (default:10M)- Can be specified in bytes (e.g.,
10485760) - Or with suffix:
K,M,G,KB,MB,GB(e.g.,50MB,1G)
- Can be specified in bytes (e.g.,
Example with custom memory limit:
docker run -d \
-p 8899:8899 \
-e BOTTLE_MEMFILE_MAX=50MB \
-v mwlib-cache:/var/cache/mwlib \
docker-wikiteq-mwlib/var/cache/mwlib: Cache directory for rendered content (recommended to mount as a volume)
8899: Main service port for mwlib services
- nserve.py patch: Adds support for configurable
BOTTLE_MEMFILE_MAXvia environment variable - Pillow/ReportLab compatibility: Fixes
.tostring()to.tobytes()for Python 3 compatibility - PNG decompression limits: Increases limits for handling large PNG files
The image includes fonts for multiple languages:
- Arabic (FarsiWeb)
- Chinese (AR PL UMing)
- Thai (TLWG Garuda)
- Hindi and other Indic languages (Lohit fonts)
- Khmer (KhmerOS)
- Latin (Liberation fonts)
- And many more