Sign inSign up

formwandler/parsoid

By formwandler

Updated over 6 years ago

Parsoid image for the VisualEditor of MediaWiki.

Image
1

422

formwandler/parsoid repository overview

Parsoid image based on official debian image that runs the Parsoid service needed for the VisualEditor of MediaWiki. Node.js is installed when building the image.

Dockerfile:

FROM debian
MAINTAINER Ralf Kruedewagen <[email protected]>
# for HTTPS sources
RUN apt-get update && apt-get install -y apt-transport-https
# Install Node.js
RUN apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get update && apt-get install -y nodejs
# Add Parsoid repo
RUN apt-key advanced --keyserver keys.gnupg.net --recv-keys AF380A3036A03444
RUN echo "deb https://releases.wikimedia.org/debian jessie-mediawiki main" > /etc/apt/sources.list.d/parsoid.list
# Install Parsoid
RUN apt-get update && apt-get install -y parsoid
# Copy config
ADD config.yaml /etc/mediawiki/parsoid/
EXPOSE 8142
CMD ["/usr/bin/nodejs", "/usr/lib/parsoid/src/bin/server.js", "-c", "/etc/mediawiki/parsoid/config.yaml"]

Parsoid config config.yaml ("conf:" section):

       mwApis:
        - # This is the only required parameter,
          # the URL of you MediaWiki API endpoint.
          uri: 'https://dockerhost/w/api.php'
          domain: 'localhost'  # optional
        - # This is the only required parameter,
          # the URL of you MediaWiki API endpoint.
          uri: 'http://www.example.org/w/api.php'
          domain: 'example.org'  # optional

        # Use selective serialization (default false)
        useSelser: true

        # Allow override of port/interface:
        serverPort: 8142
        #serverInterface: '127.0.0.1'

        # Require SSL certificates to be valid (default true)
        # Set to false when using self-signed SSL certificates
        strictSSL: false

Building the image:

docker build -t parsoid /path/to/Dockerfile/

Creating and running a container (with two Parsoid domains running on the Docker host):

docker run -d --name parsoid -p 8142:8142 --add-host=dockerhost:172.17.0.1 --add-host=www.example.org:172.17.0.1 parsoid

MediaWiki configuration for one domain (MediaWiki runs on the Docker host):

$wgVirtualRestConfig['modules']['parsoid'] = array(
    'url' => 'http://localhost:8142',
    'domain' => 'example.org',
    'prefix' => 'example.org'
);

ToDo:

  • make the Parsoid URLs (settings) configurable when creating the container
  • more elegant way to access (address) the Docker host from within the container

Tag summary

Content type

Image

Digest

Size

189.4 MB

Last updated

over 6 years ago

docker pull formwandler/parsoid