Skip to content

Changes to WORDPRESS_CONFIG_EXTRA ignored unless wp-config.php is deleted #333

Closed
@jfahrenkrug

Description

@jfahrenkrug

First of all, thank you for the hard word on this Docker image!

I have the following issue: I run the Wordpress image with docker-compose and I set several environment variables:

WORDPRESS_DB_HOST: xx
WORDPRESS_DB_USER: root
WORDPRESS_DB_PASSWORD: xx
WORDPRESS_DB_NAME: wordpress

Whenever I change any of those values and re-run docker-compose up, the wp-config.php (which lives on a mounted volume) gets updated.

However, I also have the WORDPRESS_CONFIG_EXTRA environment variable set in my docker-compose.yml. After a morning of trial and error (mostly error) of changing values in WORDPRESS_CONFIG_EXTRA I just realized that those changes were never written to wp-config.php.

I understand that we are using the safe route of not messing with wp-config.php unless it's an easy to find value like WORDPRESS_DB_NAME. It would be nice to provide an option for this, though. It's a bit surprising that changes to all other environment variables are picked up, but not the changes to WORDPRESS_CONFIG_EXTRA.

Could we add marker or delimiter strings around that block? That way we could easily find and replace it. Something like this:

// ---------  WORDPRESS_CONFIG_EXTRA BEGIN ---------
// NOTE: Everything in this block will be overwritten by the WORDPRESS_CONFIG_EXTRA
// environment variable!

<contents of WORDPRESS_CONFIG_EXTRA goes here>

// ---------  WORDPRESS_CONFIG_EXTRA END ---------

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUsability question, not directly related to an error with the image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions