Skip to content

Instantly share code, notes, and snippets.

@manoj23
Last active April 19, 2016 23:21
Show Gist options
  • Save manoj23/4e7fe1c494a1403d85473627825e9fa5 to your computer and use it in GitHub Desktop.
Save manoj23/4e7fe1c494a1403d85473627825e9fa5 to your computer and use it in GitHub Desktop.
Run wikimedia with mysql on Docker
version: '2'
services:
mediawiki:
image: wikimedia/mediawiki
links:
- mysql
environment:
- MEDIAWIKI_DB_TYPE=mysql
- MEDIAWIKI_DB_USER=root
- MEDIAWIKI_DB_PASSWORD=mysecretpassword
- MEDIAWIKI_RESTBASE_URL=http://mediawiki-node-services.docker:7231/localhost/v1
volumes:
- /local/data/dir:/data:rw
mysql:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=mysecretpassword

Run wikimedia with mysql on Docker

This gist intends to summurize my attempt to run wikimedia using Docker.

docker run --name mysql -e MYSQL_ROOT_PASSWORD=mysecretpassword -d mysql
docker run --name test-wikimedia --link mysql -v /local/data/dir:/data:rw \
-e MEDIAWIKI_RESTBASE_URL=http://mediawiki-node-services.docker:7231/localhost/v1 -d wikimedia/mediawiki

Then, connect on http://172.17.0.3/. You may need to wait a little before succeeding to get the wikimedia page. During the configuration of the wikimedia, you will be asked for the MySQL Database host which is 172.17.0.2. In the end of the configuration, copy LocalSettings.php to /local/data/dir/.

Instead of running the two docker commands, we could also use docker-compose. The file docker-compose.yml should be in a folder. Go into the folder and run docker-compose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment