--- /dev/null
+FROM php:8.2-apache
+
+RUN apt-get update && apt-get install -y \
+ zip \
+ unzip \
+ libpng-dev \
+ libjpeg-dev \
+ libfreetype6-dev \
+ libsqlite3-dev \
+ imagemagick \
+ && docker-php-ext-configure gd --with-freetype --with-jpeg \
+ && docker-php-ext-install gd pdo pdo_sqlite \
+ && rm -rf /var/lib/apt/lists/*
+
+# Install composer
+COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
+
+# Download and setup QuickInstall
+ADD https://api.github.com/repos/phpbb/quickinstall/zipball/1.6.15 /tmp/quickinstall.zip
+RUN unzip /tmp/quickinstall.zip -d /tmp/qi \
+ && mv /tmp/qi/phpbb-quickinstall-* /var/www/html/quickinstall \
+ && rm /tmp/quickinstall.zip \
+ && cd /var/www/html/quickinstall && composer install --no-dev
+
+# Add phpBB source to QuickInstall's sources directory (extracted)
+COPY phpBB-3.3.15.zip /tmp/
+RUN unzip /tmp/phpBB-3.3.15.zip -d /var/www/html/quickinstall/sources/ \
+ && rm /tmp/phpBB-3.3.15.zip
+
+# Set permissions for QuickInstall
+RUN mkdir -p /var/www/html/quickinstall/boards \
+ && mkdir -p /var/www/html/quickinstall/cache \
+ && mkdir -p /var/www/html/quickinstall/settings
+
+# Add saved profile
+COPY debianforumde.json /var/www/html/quickinstall/settings/
+
+# Copy dfde-theme into sources for board creation
+COPY dfde-theme /var/www/html/quickinstall/sources/phpBB3/styles/dfde
+
+# Copy board creation script
+COPY create-board.php /var/www/html/quickinstall/
+
+# Set permissions before running the script
+RUN chown -R www-data:www-data /var/www/html/quickinstall
+
+# Create the board during build
+RUN cd /var/www/html/quickinstall && php create-board.php dfde
+
+# Fix permissions after board creation
+RUN chown -R www-data:www-data /var/www/html/quickinstall
--- /dev/null
+<?php
+/**
+ * CLI script to create a phpBB board using QuickInstall
+ *
+ * Usage: php create-board.php <board_name>
+ *
+ * This script bootstraps QuickInstall and invokes the board creation module
+ * to create a fully populated board during Docker build.
+ */
+
+if (php_sapi_name() !== 'cli') {
+ die("This script must be run from the command line.\n");
+}
+
+if ($argc < 2) {
+ die("Usage: php create-board.php <board_name>\n");
+}
+
+$board_name = $argv[1];
+
+// Change to QuickInstall directory
+chdir('/var/www/html/quickinstall');
+
+// Define required constants
+define('IN_PHPBB', true);
+define('IN_QUICKINSTALL', true);
+define('IN_INSTALL', true);
+
+$quickinstall_path = './';
+$phpbb_root_path = $quickinstall_path . 'sources/phpBB3/';
+$phpEx = 'php';
+
+// Report all errors, except notices
+$level = E_ALL ^ E_NOTICE;
+
+// Include scripts for quickinstall
+require("{$quickinstall_path}includes/qi_constants.$phpEx");
+require("{$quickinstall_path}includes/qi.$phpEx");
+require("{$quickinstall_path}includes/settings.$phpEx");
+require("{$quickinstall_path}includes/qi_functions.$phpEx");
+require("{$quickinstall_path}includes/qi_file.$phpEx");
+require("{$quickinstall_path}includes/qi_module.$phpEx");
+require("{$quickinstall_path}includes/twig.$phpEx");
+require("{$quickinstall_path}vendor/autoload.$phpEx");
+
+if (PHP_VERSION_ID >= 50400) {
+ if (!defined('E_STRICT')) {
+ define('E_STRICT', 2048);
+ }
+ $level &= ~E_STRICT;
+}
+
+if (PHP_VERSION_ID >= 50500) {
+ if (!defined('E_DEPRECATED')) {
+ define('E_DEPRECATED', 8192);
+ }
+ $level &= ~E_DEPRECATED;
+}
+error_reporting($level);
+
+// Define STRIP constant
+define('STRIP', false);
+
+// Set limits
+@set_time_limit(0);
+@ini_set('memory_limit', '256M');
+
+// Set PHP error handler to qi's handler
+set_error_handler(array('qi', 'msg_handler'), E_ALL);
+
+// Load settings from the debianforumde profile
+$settings = new settings($quickinstall_path);
+$settings->import_profile('debianforumde');
+
+// Get phpBB version and load dependencies
+$phpbb_version = get_phpbb_version($phpbb_root_path);
+
+if (file_exists($phpbb_root_path . 'phpbb/class_loader.' . $phpEx)) {
+ define('PHPBB_31', true);
+
+ require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
+ $phpbb_class_loader = new \phpbb\class_loader('phpbb\\', $phpbb_root_path . 'phpbb/', $phpEx);
+ $phpbb_class_loader->register();
+
+ require($phpbb_root_path . 'vendor/autoload.' . $phpEx);
+}
+
+if (!file_exists($phpbb_root_path . 'includes/functions_install.' . $phpEx) || version_compare($phpbb_version, '3.2', '>=')) {
+ define('PHPBB_32', true);
+}
+
+if (file_exists($phpbb_root_path . 'vendor-ext') || version_compare($phpbb_version, '4.0', '>=')) {
+ define('PHPBB_40', true);
+}
+
+require($phpbb_root_path . 'includes/functions.' . $phpEx);
+require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
+
+if (!function_exists('phpbb_email_hash') || version_compare($phpbb_version, '3.3', '>=')) {
+ define('PHPBB_33', true);
+}
+
+// Need to set prefix here before constants.php are included
+$table_prefix = $settings->get_config('table_prefix', '');
+
+require($phpbb_root_path . 'includes/constants.' . $phpEx);
+
+if (!qi::phpbb_branch('3.2')) {
+ require($phpbb_root_path . 'includes/functions_install.' . $phpEx);
+}
+
+// Initialize user, cache, auth - mirroring index.php exactly
+if (qi::phpbb_branch('3.1')) {
+ if (qi::phpbb_branch('3.2')) {
+ $cache_dir = $quickinstall_path . $settings->get_config('cache_dir', '');
+ $cache = new \phpbb\cache\driver\file($cache_dir);
+ $user = new \phpbb\user(
+ new \phpbb\language\language(
+ new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
+ '\phpbb\datetime'
+ );
+ } else {
+ $user = new \phpbb\user('\phpbb\datetime');
+ $cache = new \phpbb\cache\driver\file();
+ }
+
+ $auth = new \phpbb\auth\auth();
+ require($phpbb_root_path . 'includes/functions_compatibility.' . $phpEx);
+} else {
+ require($phpbb_root_path . 'includes/acm/acm_file.' . $phpEx);
+ require($phpbb_root_path . 'includes/auth.' . $phpEx);
+ require($phpbb_root_path . 'includes/cache.' . $phpEx);
+ require($phpbb_root_path . 'includes/session.' . $phpEx);
+
+ $user = new user();
+ $auth = new auth();
+ $cache = new cache();
+}
+
+// Initialize template
+$template = new twig($user, $settings->get_cache_dir(), $quickinstall_path);
+
+// Apply QuickInstall language
+qi::apply_lang($settings->get_config('qi_lang', 'en'));
+
+// Validate settings
+if (!$settings->validate()) {
+ $errors = $settings->get_errors();
+ echo "Settings validation errors:\n";
+ foreach ($errors as $error) {
+ if (is_array($error)) {
+ echo " - " . implode(': ', $error) . "\n";
+ } else {
+ echo " - $error\n";
+ }
+ }
+ exit(1);
+}
+
+// Set config as per index.php
+if (qi::phpbb_branch('3.1')) {
+ $config = new \phpbb\config\config(array(
+ 'load_tplcompile' => '1',
+ ));
+ qi_set_config(false, false, false, $config);
+ qi_set_config_count(null, null, null, $config);
+} else {
+ $config = array(
+ 'load_tplcompile' => '1',
+ );
+}
+
+// Set the board name via POST simulation
+$_POST['dbname'] = $board_name;
+$_REQUEST['dbname'] = $board_name;
+
+echo "Creating board '$board_name' with profile 'debianforumde'...\n";
+
+// Load and run the create module
+require("{$quickinstall_path}modules/qi_create.$phpEx");
+
+$create_module = new qi_create();
+$create_module->run();
+
+echo "Board '$board_name' created successfully!\n";
--- /dev/null
+{
+ "qi_lang": "en",
+ "cache_dir": "cache\/",
+ "boards_dir": "boards\/",
+ "boards_url": "boards\/",
+ "make_writable": "0",
+ "grant_permissions": "",
+ "dbms": "sqlite3",
+ "dbhost": "\/var\/www\/html\/quickinstall\/boards\/",
+ "dbport": "",
+ "dbuser": "dbuser",
+ "dbpasswd": "dbpassword",
+ "no_dbpasswd": "0",
+ "db_prefix": "qi_",
+ "table_prefix": "phpbb_",
+ "server_name": "localhost",
+ "server_port": "80",
+ "cookie_domain": "",
+ "cookie_secure": "0",
+ "admin_name": "admin",
+ "admin_pass": "password",
+ "admin_email": "qi_admin@phpbb-quickinstall.tld",
+ "site_name": "Testing Board",
+ "site_desc": "QuickInstall sandbox",
+ "default_lang": "en",
+ "qi_tz": "UTC",
+ "other_config": "session_length;999999\n#load_tplcompile;1;1\n#This is a comment...",
+ "board_email": "qi_board@phpbb-quickinstall.tld",
+ "email_enable": "0",
+ "smtp_delivery": "0",
+ "smtp_host": "",
+ "smtp_port": "25",
+ "smtp_auth": "PLAIN",
+ "smtp_user": "",
+ "smtp_pass": "",
+ "populate": "1",
+ "num_users": "100",
+ "num_new_group": "10",
+ "email_domain": "phpbb-quickinstall.tld",
+ "create_admin": "1",
+ "create_mod": "1",
+ "num_cats": "2",
+ "num_forums": "10",
+ "num_topics_min": "5",
+ "num_topics_max": "25",
+ "num_replies_min": "0",
+ "num_replies_max": "50",
+ "chunk_post": "1000",
+ "chunk_topic": "2000",
+ "chunk_user": "5000",
+ "alt_env": "",
+ "redirect": "1",
+ "install_styles": "1",
+ "default_style": "debianforum.de",
+ "drop_db": "0",
+ "delete_files": "0",
+ "debug": "0"
+}
\ No newline at end of file