Changelog
https://www.mediawiki.org/wiki/MediaWiki-Docker
version: '3' services: mediawiki: image: mediawiki restart: always ports: - 11111:80 links: - database volumes: - /var/mediawiki/images:/var/www/html/images # After initial setup, download LocalSettings.php to the same directory as # this yaml and uncomment the following line and use compose to restart # the mediawiki service # - /var/mediawiki/LocalSettings.php:/var/www/html/LocalSettings.php networks: - mediawiki-net database: image: mariadb restart: always environment: MYSQL_DATABASE: wikidb MYSQL_USER: wikiuser MYSQL_PASSWORD: example MYSQL_ROOT_PASSWORD: example2 volumes: - /var/mediawiki/mysql:/var/lib/mysql networks: - mediawiki-net networks: mediawiki-net:
Note the MariaDB root password will be properly initialized only if the volume begins empty, otherwise the initialized database is started up instead. To check if sudo docker-compose down -v
removes the volume data.
To copy the SQL dump: sudo docker cp dumpfile.sql mariadb_container_name:/
References:
utf8mb4
/etc/backup_aws/backup-s15wiki-nas
For porting issues with MathJax, consider the following explanation and hacks:
Consider adding the override files for mariadb as well.
For bare metal installation:
sudo apt install nginx-full sudo apt install mariadb-server # For Mediawiki 1.39 sudo apt install php php-apcu php-intl php-mbstring php-xml php-mysql php-calendar php-fpm # For Mediawiki 1.32 sudo add-apt-repository ppa:ondrej/php sudo apt update sudo apt install php7.4 php7.4-fpm php7.4-apcu php7.4-intl php7.4-mbstring php7.4-xml php7.4-mysql php7.4-calendar # Secure for production, and test root password sudo mysql_secure_installation mysql -uroot -p MariaDB> CREATE DATABASE my_wiki; mysql -p wikidb < mysql.dump # Unpack and move to location tar xzhf mediawiki-*.tar.gz sudo mv mediawiki-*/ /var/www/mediawiki/ cd /var/www sudo chown -R www-data:www-data mediawiki sudo chmod 755 mediawiki
Issues with upgrading Mediawiki 1.32 to 1.39, including:
maintenance/update.php
itself. Gave up.Set the whole wiki as read-only:
# Set as read-only $wgReadOnly = ( PHP_SAPI === 'cli' ) ? false : 'This wiki is currently being upgraded to a newer software version. Please check back in a couple of hours.'; $wgMessageCacheType = $wgMainCacheType = $wgParserCacheType = $wgSessionCacheType = CACHE_NONE; $wgLocalisationCacheConf['storeClass'] = 'LCStoreNull'; # Disable editing - optional since only affects ACLs $wgGroupPermissions['*']['edit'] = false; $wgGroupPermissions['user']['edit'] = false; $wgGroupPermissions['sysop']['edit'] = false; # Disable new user registrations $wgGroupPermissions['*']['createaccount'] = false; $wgGroupPermissions['sysop']['createaccount'] = false; # Hide login link $wgHooks['SkinTemplateNavigation::Universal'][] = function ( $skinTemplate, &$links ) { unset( $links['user-menu']['createaccount'] ); unset( $links['user-menu']['login'] ); unset( $links['user-menu']['login-private'] ); unset( $links['user-menu']['anoncontribs'] ); };