GithubHelp home page GithubHelp logo

mediawiki-docker-dev's Introduction

Instructions

If you don't want to use the default port of 8080 and the default mediawiki path of ~/dev/git/gerrit/mediawiki then please just change the .env file for now....

Install

1) Install Docker & Docker Compose

https://docs.docker.com/compose/install/

If you don't want to run the container as root, you will have to add your user to the docker group: https://askubuntu.com/questions/477551/how-can-i-use-docker-without-sudo#477554

2) Clone this repository

git clone https://github.com/addshore/mediawiki-docker-dev.git

3) Clone MediaWiki Core & the Vector Skin

From Wikimedia Gerrit:

git clone https://gerrit.wikimedia.org/r/mediawiki/core ~/dev/gerrit/mediawiki
git clone https://gerrit.wikimedia.org/r/mediawiki/skins/Vector ~/dev/gerrit/mediawiki/skins/Vector

Or from Github Mirror (often quicker):

git clone https://github.com/wikimedia/mediawiki.git ~/dev/gerrit/mediawiki
git clone https://github.com/wikimedia/mediawiki-skins-Vector.git ~/dev/gerrit/mediawiki/skins/Vector

# You can then set the remote to point back to gerrit:

git remote set-url origin https://gerrit.wikimedia.org/r/mediawiki/core
git remote set-url origin https://gerrit.wikimedia.org/r/mediawiki/skins/Vector

4) Create a basic LocalSettings.php

The .docker/LocalSettings.php file will exist within the containers running Mediawiki.

Make a LocalSettings.php in the root of the Mediawiki repo containing the following:

<?php
require_once __DIR__ . '/.docker/LocalSettings.php';

5) Update your local hosts file

You will need to check the ./config/local/hosts file and add these to your local hosts file.

Operation

You need to populate your hosts file to get the most out of this docker stuff (see above).

To set up the containers:

This includes setting up a default wiki @ https://default.web.mw.local:8080

You can choose the spec of the system that the up command will set up by using a custom .env file called local.env and customizing the variables.

./up

To stop the containers:

Databases persist.

./stop

To restart the containers:

If things have already been setup using up.

./start

To tear down the containers:

Removes databases.

./down

Run commands on the webserver:

If the containers are running you can use the ./bash script to open up a interactive shell on the webserver.

This can be used to run tests, maintenance scripts etc.

./bash

Add a new site:

You can add a new site by name using the ./addsite command

./addsite enwiki

Run tests:

./phpunit --wiki default //var/www/mediawiki/extensions/FileImporter/tests/phpunit

Access

Debugging

While using PHP you can use remote xdebug debugging.

To do so you need to set IDELOCALHOST in you local.env file to the IP of your local machine (where you run your IDE) as it appears to docker.

xdbeug connecitons will then be sent to this IP address on port 9000.

TODO

  • FIX HHVM strict mode
    • Strict Warning: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function.
  • Statsv endpoint
  • Setup awesome hosts file additions & removals
  • Should be able to run with no internet (so do something about composer install step))

mediawiki-docker-dev's People

Contributors

addshore avatar dereckson avatar gbirke avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.