The phpBB SaaS service need database maintenance scripts, for example to create a new database for a forum, with a dedicated MySQL account.
Site information is stored in a SQLite database (to be migrated to Vault) on the Docker engine host, located at /srv/phpbb/sites/sites.db.
This SQLite database will have the following schema:
/srv/phpbb/sites/sites.db
CREATE TABLE sites (id text, host text, db_user text, db_password text, db_prefix, active boolean);
A createdb <id> script will read sites.db and create the {id} database and grants an access to {db_user}, using {db_password}.
The image is as simple as
Dockerfile
FROM nasqueron/php-cli COPY files /
The phpbb Docker wrapper will then be able to run a temporary container linked to the MySQL container phpbb_db, with /srv/phpbb/sites mounted as volume:
$ docker run --rm \ -v /srv/phpbb/sites:/data \ --link phpbb_db:db nasqueron/saas-phpbb <command> <arguments>