# 哪些设置可以在不重新构建容器的情况下进行配置？

**URL:** https://meta.discourse.org/t/which-settings-can-be-configured-without-a-container-rebuild/116266
**Category:** Self-hosting
**Tags:** hosting
**Created:** [2019年四月29日 17:46 UTC](https://meta.discourse.org/t/which-settings-can-be-configured-without-a-container-rebuild/116266 "2019-04-29T17:46:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![russellwstanley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/russellwstanley/32/156979_2.png) [@russellwstanley](https://meta.discourse.org/u/russellwstanley)
#### Post date: [2019年四月29日 17:46 UTC](https://meta.discourse.org/t/which-settings-can-be-configured-without-a-container-rebuild/116266/1 "2019-04-29T17:46:43Z")

</div>

你好

有一个关于将相同的 Discourse 镜像部署到多个环境（如预发布、测试版、生产环境等）的问题。

我希望在 CI/CD 流水线中只构建一次 Discourse 镜像，将其推送到仓库，然后在所有环境中运行完全相同的 Discourse 镜像。我希望环境之间的差异（如主机名等）通过环境变量或容器外部的配置文件来表示。根据我对 Discourse 的使用经验，目前并不完全清楚哪些设置是固化在镜像中的，哪些可以通过修改 YAML 文件（无需重新构建）安全地进行配置。

请问是否有某个地方列出了可以在每个环境中安全配置而无需重新构建容器的变量？

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2019年四月29日 17:52 UTC](https://meta.discourse.org/t/which-settings-can-be-configured-without-a-container-rebuild/116266/2 "2019-04-29T17:52:57Z")

</div>

Welcome, @russellwstanley. There has been lots of discussion of people who want to be able to have a docker\_compose file that solves all their problems, but it’s not quite that simple. There has been much discussion about this (that I can’t find in 30 seconds).

To see what settings you can pass to the container you can look at [discourse/config/discourse.config.sample at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/config/discourse.config.sample) and [discourse/config/site\_settings.yml at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/config/site_settings.yml) to see what can be configured with environment variables.

But some things need to be done with things like

```
rake db:migrate
rake assets:precompile

```

so even if you get an image that has all the right stuff, it’s not quite as simple as just cranking it up.

---

<div class="post-metadata">

### Author: ![russellwstanley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/russellwstanley/32/156979_2.png) [@russellwstanley](https://meta.discourse.org/u/russellwstanley)
#### Post date: [2019年四月29日 19:31 UTC](https://meta.discourse.org/t/which-settings-can-be-configured-without-a-container-rebuild/116266/3 "2019-04-29T19:31:40Z")

</div>

Thanks so much for your quick reply @pfaffman. I’ll take a look at those settings and see if I can make something work.
