Last active
August 14, 2024 20:13
-
-
Save DRKV333/276c25163dfb5514fe22c640c4542785 to your computer and use it in GitHub Desktop.
A compose file for automatically setting up a blank MediaWiki instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| mediawiki: | |
| image: mediawiki:1.42 | |
| ports: | |
| - 8080:80 | |
| command: > | |
| bash -c ' | |
| if [[ ! -f /var/www/html/LocalSettings.php ]]; then | |
| max_retry=5 | |
| counter=0 | |
| until /var/www/html/maintenance/run install --server $SERVER_URL --dbpass $MARIADB_PASSWORD --dbuser wikiuser --dbname wikidb --dbserver mariadb --dbtype mysql --installdbpass $MARIADB_PASSWORD --installdbuser wikiuser --pass $ADMIN_PASS --scriptpath "" --with-extensions $WIKI_NAME admin | |
| do | |
| echo "Wiki setup failed. The db is probably not available yet. Will retry in a bit." | |
| sleep 5 | |
| [[ counter -eq $$max_retry ]] && exit 1 | |
| echo "Trying again. Try #$$counter" | |
| ((counter++)) | |
| done | |
| sed -E -i "s/wgDefaultSkin = '"'"'.+'"'"';/wgDefaultSkin = '"'"'$DEFAULT_SKIN'"'"';/" LocalSettings.php | |
| fi | |
| exec apache2-foreground | |
| ' | |
| volumes: | |
| - images:/var/www/html/images | |
| mariadb: | |
| image: mariadb | |
| environment: | |
| MARIADB_DATABASE: wikidb | |
| MARIADB_USER: wikiuser | |
| MARIADB_PASSWORD: $MARIADB_PASSWORD | |
| MARIADB_ROOT_PASSWORD: $MARIADB_ROOT_PASSWORD | |
| volumes: | |
| - dbdata:/var/lib/mysql | |
| phpmyadmin: | |
| image: phpmyadmin | |
| ports: | |
| - 8081:80 | |
| environment: | |
| PMA_HOST: mariadb | |
| volumes: | |
| dbdata: | |
| images: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MARIADB_PASSWORD=ChangeMe | |
| MARIADB_ROOT_PASSWORD=ChangeMeToo | |
| SERVER_URL=http://localhost:8080 | |
| ADMIN_PASS=ChangeMeAsWell | |
| WIKI_NAME=MediaWiki | |
| DEFAULT_SKIN=vector |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment