- Without access to the CLI.
- Uploading files yourself (including everything in /vendor).
Deploying a new version of phpBB becomes then as easy as pulling the latest version of phpBB with Git and then pushing it to your VPS. Composer runs on the VPS post-push to install everything in /vendor directory. Additionally, you can define in composer the entire PHP environment. (PHP version and PHP extensions) and Dokku (or simular) will take care of providing it.
1.) Dokku, Heroku and Symfony (nowadays) discourage you to store any configuration (config.php) in a file but highly suggest environment variables for security and ease. (See the links)
Usually, (Dokku, Heroku, Symfony) the environment variable for connecting to the database is called
DATABASE_URL. You don't have to copy paste any password and username, host, port and database name.
I did a test with Dokku yesterday with a fresh install and I modified my config.php to:
Code: Select all
<?php $parsed = parse_url(getenv('DATABASE_URL')); $dbms = 'phpbb\\db\\driver\\postgres'; $dbhost = $parsed['host']; $dbport = $parsed['port']; $dbname = trim($parsed['path'], '/'); $dbuser = $parsed['user']; $dbpasswd = $parsed['pass']; $table_prefix = 'phpbb_'; $phpbb_adm_relative_path = 'adm/'; $acm_type = 'phpbb\\cache\\driver\\file'; @define('PHPBB_INSTALLED', true); @define('PHPBB_DISPLAY_LOAD_TIME', true); @define('DEBUG', true); @define('DEBUG_CONTAINER', true);
You can't set the config.php beforehand and then generate the tables. The install script wants to write the config.php itself. Maybe install with a CLI command (without generating config.php) would be a good addition?
Note: the install script forced me to set a table prefix. Why can't it be left without prefix?
2.) Storage of files: Dokku and other Heroku style PaaS use a ephemeral file system (see the links). Every deployment an entirely new docker container gets launched with only the files that are present in the git repository. All files that were uploaded to the local filesystem are destroyed (i.e. attachments). So you can't use the local filesystem for storing files except for cache files. It would be better if phpBB is storage agnostic. This extension seems to provide a solution if you want to use AWS S3. (See the link of the extension for a good explanation why storage should be agnostic).
Looking forward your comments.