Closed
Description
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
.
Metadata
Metadata
Assignees
Labels
No labels