# Docker deployment with custom site\_settings.yml

**URL:** https://meta.discourse.org/t/docker-deployment-with-custom-site-settings-yml/31914
**Category:** SSO
**Tags:** discourseconnect
**Created:** [August 9, 2015, 2:09am UTC](https://meta.discourse.org/t/docker-deployment-with-custom-site-settings-yml/31914 "2015-08-09T02:09:38Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![zingbats](https://avatars.discourse-cdn.com/v4/letter/z/a6a055/32.png) [@zingbats](https://meta.discourse.org/u/zingbats)
#### Post date: [August 9, 2015, 2:09am UTC](https://meta.discourse.org/t/docker-deployment-with-custom-site-settings-yml/31914/1 "2015-08-09T02:09:38Z")

</div>

Hello,

I’m trying to follow the SSO instructions, which requires a site\_settings.yml customization. I’m currently deploying to production using docker using [GitHub - discourse/discourse\_docker: A Docker image for Discourse · GitHub](https://github.com/discourse/discourse_docker).

Is there a supported way to customize site\_settings.yml without breaking the whole docker deployment method?

Also, in pursuit of SSO goodness I found this plugin [GitHub - mikamai/discourse-doorkeeper-sso: authentication plugin for discourse to be used with a doorkeeper oauth provider · GitHub](https://github.com/mikamai/discourse-doorkeeper-sso)  
which requires a secret key to be installed into the plugins directory.

The only way I can see to achieve this is to add a volume to the docker container so that the discourse app lives on the host, not in the docker image. So I think that would mean /var/www/discourse needs to live on the host.

Also, is anyone doing discourse development/deployment with Docker? Anyone have a Docker-compose file they’d share?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [August 13, 2015, 11:08pm UTC](https://meta.discourse.org/t/docker-deployment-with-custom-site-settings-yml/31914/2 "2015-08-13T23:08:39Z")

</div>

What? No, just set the site settings through the ui, which gets saved to the database. The yml file lists the defaults and type info.

---

<div class="post-metadata">

### Author: ![captainmisterhagan](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@captainmisterhagan](https://meta.discourse.org/u/captainmisterhagan)
#### Post date: [March 11, 2018, 2:13am UTC](https://meta.discourse.org/t/docker-deployment-with-custom-site-settings-yml/31914/3 "2018-03-11T02:13:42Z")

</div>

Resurrecting this topic because it’s exactly on point for my question.

The UI lets us modify within the constraints built in the settings file.

I have a need to be able to modify those constraints, enabling me to set a value in the UI outside of the current min:max. Has anyone constructed a preferred mechanism for this? The one that springs to mind is to modify containers/app.yml and overwrite a file copy of site\_settings.yml in the guest. Can anyone improve on that?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 12, 2018, 12:15am UTC](https://meta.discourse.org/t/docker-deployment-with-custom-site-settings-yml/31914/4 "2018-03-12T00:15:16Z")

</div>

for all the settings flagged with shadowed\_by\_global can be passed in via env:

> <https://github.com/discourse/discourse/blob/main/config/site_settings.yml#L12-L14>

Any settings that are not can be amended either via server api or you could include a script to change them. If you must amend the defaults you would need to create a custom plugin.

---

<div class="post-metadata">

### Author: ![captainmisterhagan](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@captainmisterhagan](https://meta.discourse.org/u/captainmisterhagan)
#### Post date: [March 12, 2018, 6:17am UTC](https://meta.discourse.org/t/docker-deployment-with-custom-site-settings-yml/31914/5 "2018-03-12T06:17:39Z")

</div>

Thanks, Sam.

In this particular instance I’m looking to change some of the constraints around password length. That’s not globally shadowed (which is, by the way, a nice and readable solution to the problem).

If I were to use a custom plugin, I guess I’d go about that by setting the SiteSettings value during the initialisation of the plugin in Rubyland? I’ll give that a shot.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [March 17, 2018, 5:30am UTC](https://meta.discourse.org/t/docker-deployment-with-custom-site-settings-yml/31914/6 "2018-03-17T05:30:30Z")

</div>

Even simpler, I believe you can simply provide a site\_settings.yml in your plugin that replaces the setting definition.

(I do worry about the fact that you’re changing min password length, though - the common passwords protection doesn’t take into account lengths under 10.)

---

<div class="post-metadata">

### Author: ![captainmisterhagan](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@captainmisterhagan](https://meta.discourse.org/u/captainmisterhagan)
#### Post date: [March 17, 2018, 5:55am UTC](https://meta.discourse.org/t/docker-deployment-with-custom-site-settings-yml/31914/7 "2018-03-17T05:55:05Z")

</div>

Where do I provide the site settings in the plugin?

I totally agree with the whole security concern. I really do. There are legacy passwords in there that must be respected and this is a particular client group that has issues with changing their passwords. It’s… A whole complicated story, and it has a hostile party who might have access to their email as part of it.

I’m drawing the line for the admins and moderators, they have to change to a secure, generated credential. But these old members aren’t contactable safely and if we dont respect their old credentials we lose them. And if we lose them from this therapeutic context they slip through the cracks.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [March 17, 2018, 5:54pm UTC](https://meta.discourse.org/t/docker-deployment-with-custom-site-settings-yml/31914/8 "2018-03-17T17:54:39Z")

</div>

Ah. Also take a look at the migrated password plugin: [Migrated password hashes support](https://meta.discourse.org/t/migrated-password-hashes-support/19512)

The file is `config/site_settings.yml` in the plugin, just like in the main part of Discourse.

---

<div class="post-metadata">

### Author: ![captainmisterhagan](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@captainmisterhagan](https://meta.discourse.org/u/captainmisterhagan)
#### Post date: [March 17, 2018, 9:01pm UTC](https://meta.discourse.org/t/docker-deployment-with-custom-site-settings-yml/31914/9 "2018-03-17T21:01:46Z")

</div>

Yep, got that working except for the ones which are too short. Thanks!

In fact we patched it a tiny bit to increase its scope to phpbb3 in standard configuration 😀

---

<div class="post-metadata">

### Author: ![captainmisterhagan](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@captainmisterhagan](https://meta.discourse.org/u/captainmisterhagan)
#### Post date: [March 19, 2018, 12:06am UTC](https://meta.discourse.org/t/docker-deployment-with-custom-site-settings-yml/31914/10 "2018-03-19T00:06:59Z")

</div>

I think, perhaps, it is settings.yml, based on

```plaintext
unless Rails.env.test? && ENV['LOAD_PLUGINS'] != "1"
  Dir[File.join(Rails.root, "plugins", "*", "config", "settings.yml")].each do |file|
    load_settings(file)
  end
end

```

from [discourse/app/models/site\_setting.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/app/models/site_setting.rb)

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 7, 2023, 9:18pm UTC](https://meta.discourse.org/t/docker-deployment-with-custom-site-settings-yml/31914/11 "2023-06-07T21:18:52Z")

</div>


