Page MenuHomeDevCentral

Host phpBB forum
Open, NormalPublic

Description

A phpBB forum is a PHP application with:

  • immutable source code
  • mutable folders:
    • files/
    • stores/
    • ext/ (but this one could be considered as immutable too)
    • images/

If the path of those folders could be edited, we would build upon rSAASSVC, our library to map an host to a configuration.

But that's not the case, and it doesn't seem a good plan to share files and images.

Currently, we've phpBB installations for:

  • Wolfplex (to offer as an archive?)
  • Espace Win (archive)
  • Utopia (archive)

There are all archives, as new live projects tend to use Discourse.

Plan is so to deploy the application immutable code as a Docker container, with the files/ stores/ and images/ folder mounted as volumes.

To update phpBB — new version or new extension — will mean to destroy containers and to relaunch them from update image.

MySQL will be provided by a single MySQL container shared by the different forum, here with its own database.

The backup will be as simple as save the assets from the mutable data folder, and to backup the databases.

To add a new forum, we only need to add a domain in the saas/phpBB pillar file, and a new container will be launched by the paas-docker role.

Target Docker engine is Equatower.

Event Timeline

dereckson triaged this task as Normal priority.Mar 26 2018, 23:19
dereckson created this task.

Next step is to prepare the nasqueron/phpbb phpBB image.

For the configuration, we can use the following priority order:

  • our environment variables in PHPBB_
  • consider we're linked with a "db" container and read environment variables from the linked container, in DB_ENV_ and DB_PORT_
  • sensible default values (I'm not sur for the default database name)
config.php
$dbms = $_ENV['PHPBB_DB_DRIVER'] ?? 'phpbb\\db\\driver\\mysqli';
$dbhost = $_ENV['PHPBB_DB_HOST'] ?? $_ENV['DB_PORT_3306_TCP_ADDR'] ?? 'db';
$dbport = $_ENV['PHPBB_DB_PORT'] ?? $_ENV['DB_PORT_3306_TCP_PORT'] ?? '';
$dbname = $_ENV['PHPBB_DB_NAME'] ?? 'phpbb';
$dbuser = $_ENV['PHPBB_DB_USER'] ?? 'root';
$dbpasswd = $_ENV['PHPBB_DB_PASSWORD'] ?? $_ENV['DB_ENV_MYSQL_ROOT_PASSWORD'] ?? '';
$table_prefix = $_ENV['PHPBB_DB_PREFIX'] ?? 'phpbb_';
$phpbb_adm_relative_path = 'adm/';
$acm_type = 'phpbb\\cache\\driver\\file';

Then, there is the question fo what to do with the constants:

config.php constant default values auto-generated by the phpBB 3.2 installer
@define('PHPBB_INSTALLED', true);
// @define('PHPBB_DISPLAY_LOAD_TIME', true);
@define('PHPBB_ENVIRONMENT', 'production');
// @define('DEBUG_CONTAINER', true);

Reference: https://www.phpbb.com/support/docs/en/3.2/kb/article/rebuilding-your-configphp-file/

As this uses https://wiki.php.net/rfc/isset_ternary, we need to build the image on the top of rDPHPVIIFPM:

Dockerfile
FROM nasqueron/docker-nginx-php7-fpm

…

Another folder to take care of is the cache:

Fatal: ./cache/production/ is NOT writable.