|
| 1 | +# mediawiki (experiment) |
| 2 | + |
| 3 | +[MediaWiki](https://www.mediawiki.org/) using the official **[`mediawiki`](https://hub.docker.com/_/mediawiki)** Apache image and the **shared MariaDB** service (`mariadb` on `mariadb-net`). |
| 4 | + |
| 5 | +The image includes **MySQL/MariaDB** support (`mysqli`) only, not PostgreSQL—use **`apps/mariadb`**, not `apps/postgresql`, for the database. |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +1. **`nginx-proxy-net`** (e.g. from `nginx-proxy-manager`) and **`mariadb-net`** (from `apps/mariadb`) must exist; MariaDB must be running. |
| 10 | + |
| 11 | +2. Create an application database and user (names and password are up to you; `mediawiki` is a common prefix): |
| 12 | + |
| 13 | + ```bash |
| 14 | + ../../apps/mariadb/bin/mkdb.sh mediawiki |
| 15 | + ``` |
| 16 | + |
| 17 | + That creates **`mediawiki_db`**, **`mediawiki_user`**, and a generated password (and may append **`BACKUP_DATABASE_URLS`** to this directory’s `.env` if present). |
| 18 | + |
| 19 | +3. Create the images volume directory on the host: |
| 20 | + |
| 21 | + ```bash |
| 22 | + mkdir -p ../../lib/mediawiki/images |
| 23 | + ``` |
| 24 | + |
| 25 | +## Configuration |
| 26 | + |
| 27 | +```bash |
| 28 | +cp .env.example .env |
| 29 | +``` |
| 30 | + |
| 31 | +Set **`IMAGE_VERSION`** if you pin a tag. Optionally set **`TZ`**. |
| 32 | + |
| 33 | +## First-time web install |
| 34 | + |
| 35 | +1. Point your reverse proxy at **`mediawiki:80`** (or publish **`80`** temporarily—see commented **`ports`** in **`docker-compose.yml`**). |
| 36 | + |
| 37 | +2. Open the wiki URL in a browser. On **“Set up database”** use: |
| 38 | + |
| 39 | + - Database type: **MySQL/MariaDB** |
| 40 | + - Database host: **`mariadb`** |
| 41 | + - Database name: **`mediawiki_db`** (or whatever you used with **`mkdb.sh`**) |
| 42 | + - Database user / password: **`mediawiki_user`** / password from **`mkdb.sh`** |
| 43 | + |
| 44 | +3. When the installer offers **`LocalSettings.php`**, save it as **`../../lib/mediawiki/LocalSettings.php`** on the host. |
| 45 | + |
| 46 | +4. Uncomment the **`LocalSettings.php`** bind mount in **`docker-compose.yml`** and **`docker compose up -d`** again so upgrades and restarts keep your settings. |
| 47 | + |
| 48 | +## Networks |
| 49 | + |
| 50 | +- **`nginx-proxy-net`** — browser access via proxy |
| 51 | +- **`mariadb-net`** — SQL to **`mariadb:3306`** |
| 52 | + |
| 53 | +## Usage |
| 54 | + |
| 55 | +```bash |
| 56 | +docker compose up -d |
| 57 | +docker compose down |
| 58 | +docker compose logs -f |
| 59 | +``` |
| 60 | + |
| 61 | +## Healthcheck |
| 62 | + |
| 63 | +HTTP **`GET /`** on **`127.0.0.1:80`** inside the container. |
| 64 | + |
| 65 | +## Backup |
| 66 | + |
| 67 | +- MariaDB: include your wiki database in normal DB backups; **`mkdb.sh`** can add **`BACKUP_DATABASE_URLS`** to `.env`. |
| 68 | +- Files: back up **`../../lib/mediawiki`** (`images/` and **`LocalSettings.php`** after install). |
0 commit comments