MediaWiki on Docker

From EWIKI
Jump to navigation Jump to search

Set up a dedicated mysql:

docker run -d --name=wiki-mysql -v /home/mh/mysql:/var/lib/mysql  \
  --env="MYSQL_ROOT_PASSWORD=<password>" -p 3306:3306 -p 33060:33060 mysql:5.7

Check DB running

docker ps 
docker inspect wiki-mysql
mysql -u root -pmypassword -P 3306 -h 127.0.0.1

Start Wiki Container

docker run --name ewiki -d --link wiki-mysql:mysql -p 8080:80 \
  -v /home/mh/wiki:/var/www/html  -e MEDIAWIKI_DB_HOST=mysql:3306 \
  -e MEDIAWIKI_DB_PASSWORD=<password> -e MYSQL_ROOT_PASSWORD=<password> \
  -e MEDIAWIKI_DB_NAME=ewiki synctree/mediawiki

Open http://localhost:808 and configure the wiki.

Download the LocalSettings.php and copy it into /home/mh/wiki