git clone https://github.com/OpenSemanticLab/docker-compose-osl-wiki
cd docker-compose-osl-wiki
chown -R www-data:www-data mediawiki/data
nano .env
docker-compose build
docker-compose upMediaWiki's core config file LocalSettings.php is created dynamically on every container by merging
- InstallSettings.php
- DockerSettings.php
- CustomSettings.php
InstallSettings.php is created by running maintenance/install.php with parameters defined in .env on the first run. To recreate this file after change settings in .env set
        environment:
            - MW_REINSTALL=trueDockerSettings.php is copied from mediawiki/config/DockerSettings.php into the container during build.
CustomSettings.php can be mounted to the container (optional)
        volumes:
            - ./mediawiki/config/CustomSettings.php:/var/www/html/w/CustomSettings.phpTo modify LocalSettings.php without restarting the container, copy the merged file and mount it, this will skip the dynamical creation:
docker cp -L osl-mw-dev-test_mediawiki_1:/var/www/html/w/LocalSettings.php mediawiki/config/LocalSettings.phpin docker-compose.yaml:
        volumes:
            - ./mediawiki/config/LocalSettings.php:/var/www/html/w/LocalSettings.phpsudo cp misc/reverse_proxy_nginx.conf /etc/nginx/sites-enabled/default
sudo nano /etc/nginx/sites-enabled/default-> set domain and cert paths
If your instance is public, make sure to add a privacy policy to /wiki/Site:Privacy_policy and legal informations to /wiki/Site:General_disclaimer.
You may also create a single page with all necessary informations and point with a redirect from other pages to it: #REDIRECT [[Site:General_disclaimer]]
If you don't have an email server yet (optional, but necessary for notification and password resets, etc.), you can use docker-mailserver
wfLoadExtension( 'Widgets' ); wfLoadExtension( 'TwitterTag' ); #Not GDPR conform!
missing semantic properties after backup restore
php /var/www/html/w/extensions/SemanticMediaWiki/maintenance/rebuildData.phpno search results after backup restore
php /var/www/html/w/extensions/CirrusSearch/maintenance/ForceSearchIndex.phpincorrect link labels (page name instead of display name) after template changes or large imports
php /var/www/html/w/maintenance/refreshLinks.phpmissing thumbnails for tif images
php /var/www/html/w/maintenance/refreshImageMetadata.php --forcemkdir backup
docker-compose exec db /bin/bash -c 'mysqldump --all-databases -uroot -p"$MYSQL_ROOT_PASSWORD" 2>/dev/null | gzip | base64 -w 0' | base64 -d > backup/db_backup_$(date +"%Y%m%d_%H%M%S").sql.gz
tar -zcf backup/file_backup_$(date +"%Y%m%d_%H%M%S").tar mediawiki/datacleanup old data
rm -r mediawiki/data
rm -r mysql/data
rm -r blazegraph/dataimport
zcat backup/db_backup_<date>.sql.gz | docker exec -i docker-compose-osl-wiki_db_1 sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD"'
tar -xf backup/file_backup_<date>.tar
chown -R www-data:www-data mediawiki/datacheck for modificated extensions
cd /var/www/html/w/extensions/
find . -maxdepth 1 -mindepth 1 -type d -exec sh -c '(echo {} && cd {} && git status -s && echo)' \;create debug file
touch /var/www/html/w/my-custom-debug.log
chown www-data:www-data /var/www/html/w/my-custom-debug.login LocalSettings.php:
$wgDebugLogFile = "/var/www/html/w/my-custom-debug.log";in PHP source code:
wfDebug( "\n[tag] some debug message: $somevar.\n" );remove and recreate logfile
rm /var/www/html/w/my-custom-debug.log && touch /var/www/html/w/my-custom-debug.log && chown www-data:www-data /var/www/html/w/my-custom-debug.logcopy files
docker cp mediawiki/config/pub/* osl-wiki_mediawiki_1:/var/www/html/w/pub/triggers CI/CD workflow and pushes image with tags to docker registry (see also stackoverflow: push-git-commits-tags-simultaneously )
git tag <tag>
git push --atomic origin main --tags