Cli/guide/Docker-Development-Environment

A MediaWiki-Docker-Dev like developer environment.

First Setup
If you already have a LocalSettings.php file from a previous developer environment, see the LocalSettings.php section below before starting.

You can get started with a basic MediaWiki installation, first creating the needed services.

If this is your first time using the Cli then you will be guided through a setup wizard.



First setup might take some time as docker images, code and dependencies will be fetched.

And then performing a MediaWiki install

TBA gif of installation

You'll then have a MediaWiki install running on SQLite accessible at http://default.mediawiki.mwdd.localhost:8080/



LocalSettings.php
The development environment automatically sets various MediaWiki settings, such as database details. In order to do this it needs a "shim" at the top of your LocalSettings.php file.

When starting with a fresh install this will be created by the setup wizard.

If you already have a LocalSettings.php file, then you'll need to add the below snippet, removing any that may have been included from other environments.

MySQL Setup
You'll then have a MediaWiki install running on SQLite accessible at http://mysqlwiki.mediawiki.mwdd.localhost:8080/

If you want to see the database in a UI, try using the adminer or phpmyadmin services.

Other services
All services follow similar patterns of create, suspend, resume, destroy.

Services will generally be automatically configured with MediaWiki when they are run.

Using XDebug for MediaWiki
The default XDebug mode is develop,debug, and the debugger will try to connect to localhost:9003.

If you want to alter the XDebug config you can do so using an environment variable.

Triggering for requests
See https://xdebug.org/docs/step_debug#activate_debugger

Example triggering from CLI:

Alter a container environment variable
If you want to alter an environment variable on a container, you'll need to re create the container after the change.

For example:

You should see that the container recreates:

Known TODOs

 * - Automatic hosts file alterations