Now that a base `docker-compose.yml` file exists in core (T238224), I'm interested to explore the idea of a wrapper CLI tool that facilitate working with the docker-compose stack; this could be useful for both novice and expert users.
Other projects (https://github.com/physikerwelt/mediawiki-docker, https://github.com/addshore/mediawiki-docker-dev) have convenience bash scripts to do things like adding a new site, dropping a database and reinstalling (and handling copying over old LocalSettings values) etc. In theory those projects would be able to use a common wrapper CLI tool as well.
Rather than bash scripts I'd propose to use Go (inspired by the wrapper script that #local-charts folks created) so we'd have a portable binary that can be installed easily without other dependencies.
As a starting point it would probably be useful for the tool (let's call it for example `mw`) to allow for things like:
- `mw init` -- set up a docker-compose.yml.override with an interactive guide (or flags for programmatic usage) to defining database type (sqlite, mysql, postgres) and php version
- could also create a `.env` file which can be used by shared components (like `fresh-node` when running selenium tests)
- could also prompt to clone mediawiki if run in a directory that doesn't look like a mediawiki directory
- `mw install` -- installs MediaWiki; prompts to back up and restore LocalSettings.php if one exists
- `mw status` for showing extensions / skins present on file system and/or if they are loaded via LocalSettings?
- `mw get` for downloading skins/extensions
- `mw enable/disable` for adding/removing lines to LocalSettings.php for enabling/disabling skins/extensions
- `mw start` simple wrapper around docker-compose up
- `mw stop` simple wrapper around docker-compose stop
- `mw destroy` brings down the environment, removes any volumes, and deletes the `.env` file