Please add a proper startup environment option to override wordpress' siteurl & home url settings.
We just experienced quite some lost time on an annoyance where we wanted to duplicate an instance under a different url and for that we had to dive into the database to change wp_options (fields siteurl & home) because the duplicated instance would instantly redirect us back and there is no environment option to just specify the proper site URL directly when launching the container.
A huge advantage of docker & docker-compose is being able to have a nice folder with all service data & volumes in it and to be able to easily copy it, just do a one-line change in the docker-compose.yml and have it running somewhere else under a different address - and having no proper environment override for the site url breaks that workflow pretty bad.
wordpress启动请求路径解决了么?
Sort of related: #71
Is it still true that there is not a default "WORDPRESS_SITE_URL" variable? I could see this variable as simply adding this to the wp-config file much like the current variables:
define('WP_HOME','${WORDPRESS_SITE_URL}');
define('WP_SITEURL','${WORDPRESS_SITE_URL}');
While this won't find and replace everything in the database (embedded media: images, links to files), it allows grabbing a database dump of a production/staging website, using that file for docker-entrypoint-initdb.d, and then immediately opening WordPress once the container is running without being redirected to the production or staging site the database came from. Sometimes that happens without even realizing it. It would still be a good idea to find and replace all the URLs in the database, which I sometimes do directly to the sql file prior to running, but a SITE_URL variable would be reassuring.
I would appreciate the SITE and HOME variables as environment variables for initial setup.
Closing in favor of https://github.com/docker-library/wordpress/pull/142. :+1:
Most helpful comment
I would appreciate the SITE and HOME variables as environment variables for initial setup.