# Benefits of running discourse in separate containers for data and web

**URL:** https://meta.discourse.org/t/benefits-of-running-discourse-in-separate-containers-for-data-and-web/36109
**Category:** Self-hosting
**Tags:** docker, hosting
**Created:** [11월 28, 2015, 12:08오후 UTC](https://meta.discourse.org/t/benefits-of-running-discourse-in-separate-containers-for-data-and-web/36109 "2015-11-28T12:08:30Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![nesvarbu\_Pavarde](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@nesvarbu\_Pavarde](https://meta.discourse.org/u/nesvarbu_Pavarde)
#### Post date: [11월 28, 2015, 12:08오후 UTC](https://meta.discourse.org/t/benefits-of-running-discourse-in-separate-containers-for-data-and-web/36109/1 "2015-11-28T12:08:30Z")

</div>

What leverage do I gain by separating discourse installation into two or more containers. E.G. for data and web.  
Will there be scenarios where I want to upgrade and rebuild web container without rebuilding data container and losing all the data in DB.

---

<div class="post-metadata">

### Author: ![omfg](https://avatars.discourse-cdn.com/v4/letter/o/5e9695/32.png) [@omfg](https://meta.discourse.org/u/omfg)
#### Post date: [11월 28, 2015, 1:37오후 UTC](https://meta.discourse.org/t/benefits-of-running-discourse-in-separate-containers-for-data-and-web/36109/2 "2015-11-28T13:37:43Z")

</div>

Data is never lost in a rebuild, so from stated perspective you wouldn’t gain anything.

---

<div class="post-metadata">

### Author: ![nesvarbu\_Pavarde](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@nesvarbu\_Pavarde](https://meta.discourse.org/u/nesvarbu_Pavarde)
#### Post date: [11월 28, 2015, 3:01오후 UTC](https://meta.discourse.org/t/benefits-of-running-discourse-in-separate-containers-for-data-and-web/36109/3 "2015-11-28T15:01:40Z")

</div>

Lovely, so launcher transfers the data into a new container on a rebuild?

---

<div class="post-metadata">

### Author: ![Yuun](https://avatars.discourse-cdn.com/v4/letter/y/977dab/32.png) [@Yuun](https://meta.discourse.org/u/Yuun)
#### Post date: [11월 28, 2015, 4:08오후 UTC](https://meta.discourse.org/t/benefits-of-running-discourse-in-separate-containers-for-data-and-web/36109/4 "2015-11-28T16:08:23Z")

</div>

Per [https://meta.discourse.org/t/advanced-troubleshooting-with-docker/15927](https://meta.discourse.org/t/advanced-troubleshooting-with-docker/15927), the database is actually stored outside the container(s).

AFAIK the main advantage of separating containers (if you’re changing nothing else about the default install) is reducing downtime when you’re running `./launcher rebuild app`. However it’s a bit outside my knowledge and not something I’ve attempted doing, so I wouldn’t be surprised if there were more reasons to do it.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [11월 28, 2015, 6:08오후 UTC](https://meta.discourse.org/t/benefits-of-running-discourse-in-separate-containers-for-data-and-web/36109/5 "2015-11-28T18:08:03Z")

</div>

Yes, this is the main reason. You also gain flexibility; for example the ability to run the database on a separate server.
