What do you think about configure wp-config.php with Docker environment variables ?
Like this:
<?php
define('WP_CONTENT_DIR', '/var/www/wp-content');
$table_prefix = getenv('TABLE_PREFIX') ?: 'wp_';
foreach ($_ENV as $key => $value) {
$capitalized = strtoupper($key);
if (!defined($capitalized)) {
define($capitalized, $value);
}
}
if (!defined('ABSPATH'))
define('ABSPATH', dirname(__FILE__) . '/');
require_once(ABSPATH . 'wp-settings.php');
?>
source: https://codeable.io/wordpress-developers-intro-to-docker-part-two/#configuring-wp-configphp
It is useful for instance to configure FS_METHOD=direct.
See also #8, #142, #147 (comment)
ok and what we do? This request are rejected?
I want to configure FS_METHOD=direct and I don't want mount wp-config.php. What I need to do?
I would be interested to know what solution you found @harobed. I am currently trying to customize wp-config and I can't get wp-config.php mounted by itself #231 #135. So I am going to just mount /var/www/html to the host.
Strangely I can mount uploads.ini by itself.
In the hope to finally have a standard/consistent/simple/flexible and secure solution from upstream WP: https://core.trac.wordpress.org/ticket/41710
Feel free to comment there about file-based passwords (although it may still appear as a niche-case to upstream ATM)
Closing in favor of https://github.com/docker-library/wordpress/pull/142. :+1:
Most helpful comment
ok and what we do? This request are rejected?
I want to configure
FS_METHOD=directand I don't want mountwp-config.php. What I need to do?