| Line 2: |
Line 2: |
| | {{ Note|'''This document is a work in progress and should be considered a draft until this message disappears.''' }} | | {{ Note|'''This document is a work in progress and should be considered a draft until this message disappears.''' }} |
| | = Docker MediaWiki Server = | | = Docker MediaWiki Server = |
| − | Notes and configuration files for setting up MediaWiki with nginx-proxy for Let's Encrypt SSL certs. | + | Notes and configuration files for setting up MediaWiki in a dockerized environment. |
| | | | |
| | This guide is comprised of two methods for building a dockerized MediaWiki site: | | This guide is comprised of two methods for building a dockerized MediaWiki site: |
| Line 10: |
Line 10: |
| | Regardless of the method used, this guide will also include any extensions you have in the build/extensions folder. | | Regardless of the method used, this guide will also include any extensions you have in the build/extensions folder. |
| | | | |
| − | == Intranet - no proxy == | + | = Preparation = |
| − | Use this if on an Intranet with no Internet access. NGINX-Proxy is using Let's Encrypt and will fail without Internet access. If this becomes a heavily used site then consider putting this behind a proxy.
| + | There are two setups available: |
| | + | * One for Intranet use that doesn't use a proxy or SSL. |
| | + | * One for Internet use that uses NGINX as a proxy and Let's Encrypt for SSL. |
| | | | |
| − | * Create '''/srv/nginx-proxy''' | + | ===Intranet - no proxy=== |
| − | * Add this file
| + | * Create '''/srv/wiki''', '''/srv/wiki/build''', and '''/srv/wiki/build/extensions''' directories. |
| | | | |
| − | === docker-compose.yml === | + | ===Internet=== |
| | + | * Create '''/srv/wiki''', '''/srv/wiki/build''', '''/srv/wiki/build/extensions''', and '''/srv/nginx-proxy''' directories. |
| | + | |
| | + | =Installation= |
| | + | Choose the type of installation that matches the one used in the preparation section above. |
| | + | |
| | + | ==Intranet - no proxy== |
| | + | Use this if on an Intranet with no Internet access. If this becomes a heavily used site then consider putting this behind a proxy. |
| | + | |
| | + | ===MediaWiki=== |
| | + | Copy the following to '''/srv/wiki/docker-compose.yml''' |
| | | | |
| | version: '3' | | version: '3' |
| Line 62: |
Line 74: |
| | # - default | | # - default |
| | | | |
| − | == nginx-proxy ==
| |
| − | Use this if your site is on the Internet
| |
| | | | |
| − | * Create '''/srv/nginx-proxy'''
| + | ==Internet== |
| − | * Add this file
| + | For an Internet setup you will use NGINX-Proxy with Let's Encrypt for SSL certificates. |
| | | | |
| − | === docker-compose.yml === | + | ===NGINX-Proxy=== |
| − | docker-compose.yml | + | Copy the following to '''/srv/nginx-proxy/docker-compose.yml''' |
| | | | |
| | version: '2' | | version: '2' |
| Line 109: |
Line 119: |
| | name: nginx-proxy | | name: nginx-proxy |
| | | | |
| − | == MediaWiki == | + | ====Create docker network==== |
| − | * Create /srv/wiki, /srv/wiki/build, /srv/wiki/build/extensions
| + | You will need to create an additional docker network for NGINX-Proxy and MediaWiki to talk on: |
| − | * Add the following files | + | * Run '''''docker network create nginx-proxy''''' |
| | | | |
| − | === docker-compose.yml === | + | ===MediaWiki=== |
| | Copy the following to '''/srv/wiki/docker-compose.yml''' | | Copy the following to '''/srv/wiki/docker-compose.yml''' |
| | | | |
| Line 124: |
Line 134: |
| | depends_on: | | depends_on: |
| | - database | | - database |
| − | - parsoid
| + | ## parsoid is bundled as part of 1.35+, only uncomment if using an older version |
| | + | # - parsoid |
| | restart: always | | restart: always |
| | environment: | | environment: |
| Line 157: |
Line 168: |
| | networks: | | networks: |
| | - default | | - default |
| − |
| + | ## parsoid is bundled as part of 1.35+, only uncomment if using an older version |
| − | parsoid: | + | #parsoid: |
| − | image: thenets/parsoid:0.10
| + | # image: thenets/parsoid:0.10 |
| − | container_name: parsoid
| + | # container_name: parsoid |
| − | restart: always
| + | # restart: always |
| − | environment:
| + | # environment: |
| − | # - PARSOID_NUM_WORKERS=0 | + | # - PARSOID_NUM_WORKERS=0 |
| − | - PARSOID_DOMAIN_wiki=http://web/api.php
| + | # - PARSOID_DOMAIN_wiki=http://web/api.php |
| − | networks:
| + | # networks: |
| − | - default
| + | # - default |
| | | | |
| | networks: | | networks: |
| Line 173: |
Line 184: |
| | name: nginx-proxy | | name: nginx-proxy |
| | | | |
| − | === Dockerfile === | + | =Mediawiki Docker Image= |
| | + | Here you will find instructions on how to build your own custom MediaWiki docker image. |
| | + | |
| | + | ===Dockerfile=== |
| | There are two ways to create the Dockerfile for MediaWiki. | | There are two ways to create the Dockerfile for MediaWiki. |
| | | | |
| Line 195: |
Line 209: |
| | * ENV MEDIAWIKI_MAJOR_VERSION 1.36 | | * ENV MEDIAWIKI_MAJOR_VERSION 1.36 |
| | * ENV MEDIAWIKI_VERSION 1.36.1 | | * ENV MEDIAWIKI_VERSION 1.36.1 |
| − | * ENV MW_VERSION REL1_35 | + | * ENV MW_VERSION REL1_36 |
| | | | |
| | To change to version 1.35 (LTS until 2023) you can substitute 1.35, 1.35.3,and REL1_35 for the values above. | | To change to version 1.35 (LTS until 2023) you can substitute 1.35, 1.35.3,and REL1_35 for the values above. |
| Line 388: |
Line 402: |
| | CMD ["apache2-foreground"] | | CMD ["apache2-foreground"] |
| | | | |
| − | === First start === | + | =Running= |
| | + | ==First start== |
| | * Update the /srv/wiki/docker-compose.yml file with the host, email and database password | | * Update the /srv/wiki/docker-compose.yml file with the host, email and database password |
| | * Run '''''docker-compose up -d''''' to start | | * Run '''''docker-compose up -d''''' to start |
| | * Login to wiki to complete setup (use https://<fqdn> specified in the files above) | | * Login to wiki to complete setup (use https://<fqdn> specified in the files above) |
| | | | |
| − | === Database connection details === | + | ===Database connection details=== |
| | When prompted for the database enter '''db://localhost''' | | When prompted for the database enter '''db://localhost''' |
| | | | |
| − | === LocalSettings File ===
| + | ==LocalSettings File== |
| | * Download when prompted | | * Download when prompted |
| − | * Stop the wiki with '''''docker-compose down'''''
| |
| | * Copy LocalSettings.php to the /srv/wiki directory | | * Copy LocalSettings.php to the /srv/wiki directory |
| | + | |
| | + | ==Finalize setup== |
| | * Uncomment the '''#- /srv/wiki/LocalSettings.php:/var/www/html/LocalSettings.php''' line in the '''/srv/wiki/docker-compose.yml''' file | | * Uncomment the '''#- /srv/wiki/LocalSettings.php:/var/www/html/LocalSettings.php''' line in the '''/srv/wiki/docker-compose.yml''' file |
| | * chmod 755 the LocalSettings.php file | | * chmod 755 the LocalSettings.php file |
| Line 405: |
Line 421: |
| | * Wait a minute then navigate to your wiki with https://<fqdn> | | * Wait a minute then navigate to your wiki with https://<fqdn> |
| | | | |
| − | == Misc ==
| + | =Misc= |
| − | === Preventing access ===
| + | ==Preventing access== |
| | Note: You can also choose an access level at initial installation. | | Note: You can also choose an access level at initial installation. |
| | | | |
| | https://www.mediawiki.org/wiki/Manual:Preventing_access#Simple_private_wiki | | https://www.mediawiki.org/wiki/Manual:Preventing_access#Simple_private_wiki |
| − | === Upgrading ===
| + | ==Upgrading== |
| | IMPORTANT: Read https://www.mediawiki.org/wiki/Manual:Upgrading first for information about upgrading. | | IMPORTANT: Read https://www.mediawiki.org/wiki/Manual:Upgrading first for information about upgrading. |
| | | | |