Skip to content

Allow users to set additional configuration options #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

drewwestphal
Copy link

These changes allow a user to set additional configuration options via environment variables. The CONFIG_OPTS array defines variables that can be set in this fashion.

To support this feature set_config has been modified to allow users to set config options to true, false and numeric values with proper (no) escaping. I've also added blank_config and del_config functions to facilitate configuration option setting.

…ly present in config file

Allow setting configuration options to numeric and true/false values
@tianon
Copy link
Member

tianon commented Oct 8, 2014

Hey sorry for the delay on this.

I'm not sure how I feel about this. On the one hand, we've set the precedent for some of this with several of our other environment variables, but on the other hand the ones we have are the bare minimum to actually have a working Wordpress installation. Also, since we don't overwrite the configuration file and we just rewrite it in place, it's technically something a user of the image can modify to their heart's content or supply a completely new version of.

@drewwestphal
Copy link
Author

That's totally true. I coded this up and have ended up using it. Unclear whether it was ultimately a boon or not. If you guys want it, it's yours. If not, no hard feelings.

@tianon
Copy link
Member

tianon commented Oct 23, 2014

Mind if we just leave it open for a while? That way people who are interested in such a thing can come try it out and leave feedback. I think our image is still too young right now to say for sure whether this would be a boon or a wart in the long run. 😄

@drewwestphal
Copy link
Author

not at all. however long you like.

in the long run might be simpler to just write a custom config with getenv than all this sed madness anyhow. if you are pulling in versions by hand anyway it would be a pretty quick check to diff the new and old default configs to see if any changes might be required in the custom config.

On Thu, Oct 23, 2014 at 1:37 PM, Tianon Gravi [email protected]
wrote:

Mind if we just leave it open for a while? That way people who are interested in such a thing can come try it out and leave feedback. I think our image is still too young right now to say for sure whether this would be a boon or a wart in the long run. 😄

Reply to this email directly or view it on GitHub:
#8 (comment)

@bejnar
Copy link

bejnar commented Sep 28, 2015

Some feedback after using this container to setup a WordPress Multisite: I think it’s nice to be able to modify the WP configuration using environment variables via something like this pull request. This way one can use docker-compose.yml to configure WP, which has some advantages for portability and keeping track of changes within a project.

I see the point about keeping the configuration options to the minimum required by WordPress. On the other hand, since, for example, setting up multisite is a standard feature of WP, one could argue that being able to set that up would be one of those minimum required options.

@drewwestphal
Copy link
Author

For the time being you can just mount your own config and put that in the
repo
Le Mon, Sep 28, 2015 à 09:51, Roman Bejnar [email protected] a
écrit :

Some feedback after using this container to setup a WordPress Multisite: I
think it’s nice to be able to modify the WP configuration using environment
variables via something like this pull request. This way one can use
docker-compose.yml to configure WP, which has some advantages for
portability and keeping track of changes within a project.

I see the point about keeping the configuration options to the minimum
required by WordPress. On the other hand, since, for example, setting up
multisite is a standard feature of WP, one could argue that being able to
set that up would be one of those minimum required options.


Reply to this email directly or view it on GitHub
#8 (comment)
.

@bejnar
Copy link

bejnar commented Sep 29, 2015

Thank you for the tip! that seems like it would be a good way for now. As I understand it, one can mount volumes but not individual files? Apologies as I'm not sure if this is a general docker question or if it could help someone with a similar issue when using this container.

@drewwestphal
Copy link
Author

You can mount specific files.

You would want to mount your wp-config file over
/var/www/html/wp-content/wp-config.php

On Tue, Sep 29, 2015 at 1:29 PM, Roman Bejnar [email protected]
wrote:

Thank you for the tip! that seems like it would be a good way for now. As
I understand it, one can mount volumes but not individual files? Apologies
as I'm not sure if this is a general docker question or if it could help
someone with a similar issue when using this container.


Reply to this email directly or view it on GitHub
#8 (comment)
.

@zyrill
Copy link
Contributor

zyrill commented Nov 18, 2015

I actually prefer being able to set everything via env vars instead of mounting config files into the image. That way, the configuration becomes even more unencumbered from OS specifics (e.g. on win you have to use absolute paths). I would very much like to see this implemented.

@vutran
Copy link

vutran commented May 4, 2016

I am for this PR. There's a lot of more constants that WP uses that isn't available in the wp-config-sample.php so those should be exposed as env vars.

@davisshaver
Copy link

+1 to seeing some action on this. At this point the most future proof solution seems to be extending the image and copying in a custom wp-config-sample.php. It would be nice to get official support for some additional environment variables within the official image.

@lwille
Copy link

lwille commented Mar 26, 2018

See #142 for a generic solution.

@yosifkit
Copy link
Member

Closing old issue; The generic solution has been merged in #142.

@yosifkit yosifkit closed this Sep 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants