Docker Compose for MediaWiki with MariaDB, Redis and Elastic Search.
MacOS: Install Docker and docker-sync
Linux: Install Docker and Docker-compose.
on Debian based OS (Example: Ubuntu, Linux Mint) use
bin/docker.sh
instead of following the above two links
In front of the containers you can configure an nginx reverse proxy (with auto letsencrypt) that creates the "proxy" network:
Configuration
cd ~
mkdir docker;
cd docker;
git clone --recurse-submodules https://github.com/evertramos/nginx-proxy-automation.git proxy
cd proxy
cp .env.sample .env
vim .env (changed only [email protected])
cd bin && ./fresh-start.sh --yes -e [email protected] --skip-docker-image-check
cd ~/docker
git clone https://github.com/allanext/docker-compose-mediawiki-mysql-redis-elasticsearch.git mediawiki
cd mediawiki
cp .env.sample .env
Change the environment variable in the .env file
Change the docker-compose.yml configuration
I find it convenient to associate an IP address to some containers in order to ssh tunnel the server and connect directly to a specific container.
docker-compose up --build
Open your browser and go to your newly configured domain to install the MediaWiki web app
Download the LocalSettings.php and copy it to the config folder
Copy the installed database and wiki extensions to the host:
docker cp wiki_db:/var/lib/mysql db
docker cp wiki:/var/www/html/extensions extensions
In the LocalSettings.php uncomment the volumes map entries for the ./config/LocalSettings.php and ./extensions folder:
volumes:
- ./images:/var/www/html/images
# After initial setup, download LocalSettings.php and extensions to the same directory
# (e.g. docker cp wiki:/var/www/html/LocalSettings.php ./ ) as this yaml and uncomment
# the following lines and use compose to restart the mediawiki service
- ./config/LocalSettings.php:/var/www/html/LocalSettings.php
- ./extensions:/var/www/html/extensions/
Restart your containers:
docker-compose stop
docker-compose start
To install elasticsearch follow these guides:
https://www.mediawiki.org/wiki/Extension:CirrusSearch#Configuration
https://gerrit.wikimedia.org/g/mediawiki/extensions/CirrusSearch/%2B/HEAD/README
Chante the permissions to the elastic_data mapped volume:
chown -R 1000:1000 elastic_data_master/
chown -R 1000:1000 elastic_data_replica/
The host needs to set something like:
sudo sysctl -w vm.max_map_count=262144
If you encounter any problems or bugs, please create an issue on GitHub.
Please Contribute by creating a fork of this repository.
Follow the instructions here: https://help.github.com/articles/fork-a-repo/