• Hi guys.

    Would you know how to use WORDPRESS_CONFIG_EXTRA as an argument to docker/podman command? Like with usual -e I’ve been trying some variations but am unable to get resulting wp-config.php hold any extra definitions.

    I’m hoping for WP_HOME & WP_SITEURL so such WP would be deployed under a sub-path, eg.: https://some.thing/word

    many thanks, L

Viewing 1 replies (of 1 total)
  • Hi, you pass it like any other env var. Something along these lines works: docker run -e “WORDPRESS_CONFIG_EXTRA=define(‘WP_HOME’, ‘https://some.thing/word’); define(‘WP_SITEURL’, ‘https://some.thing/word’);” … The official image entrypoint appends the value to the end of wp-config.php when the container starts, so it just has to be valid PHP. I find it easier to keep it in a compose file with a block scalar rather than one long -e flag. One heads up for your sub-path setup: once the defines are in place, also make sure your reverse proxy passes the real Host header through, because otherwise WordPress can still build URLs with the container’s internal hostname.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.