# Docker setup for App and Redis

**URL:** https://meta.discourse.org/t/docker-setup-for-app-and-redis/27110
**Category:** Self-hosting
**Tags:** docker
**Created:** [2015 年 4 月 2 日午後 12:44 UTC](https://meta.discourse.org/t/docker-setup-for-app-and-redis/27110 "2015-04-02T12:44:05Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![nileshtrivedi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nileshtrivedi/32/37212_2.png) [@nileshtrivedi](https://meta.discourse.org/u/nileshtrivedi)
#### Post date: [2015 年 4 月 2 日午後 12:44 UTC](https://meta.discourse.org/t/docker-setup-for-app-and-redis/27110/1 "2015-04-02T12:44:05Z")

</div>

In discourse\_docker repo, there exist sample files standalone.yml - which includes Discourse, Postgres, Redis. And there is web\_only.yml which contains Discourse but not Postgres and Redis.

How do I make a template so that Discourse and Redis are configured using docker container but an external PostgresQL database is used. In other words, I need a web+redis.yml. How do I go about writing it?

---

<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: [2015 年 4 月 3 日午前 3:38 UTC](https://meta.discourse.org/t/docker-setup-for-app-and-redis/27110/2 "2015-04-03T03:38:00Z")

</div>

Take standalone.yml, remove postgres.template.yml, and set the pg connection info in the env variables.

---

<div class="post-metadata">

### Author: ![chamunks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chamunks/32/73257_2.png) [@chamunks](https://meta.discourse.org/u/chamunks)
#### Post date: [2015 年 4 月 3 日午前 4:42 UTC](https://meta.discourse.org/t/docker-setup-for-app-and-redis/27110/3 "2015-04-03T04:42:50Z")

</div>

@nileshtrivedi I’ve been currently working through this kind of thing myself. If I were in your shoes [I’d look at](https://github.com/discourse/discourse_docker/tree/master/samples):

```
samples/data.yml
samples/web_only.yml

```

Just take all of the Redis settings and references out of the data.yml and paste them into the web\_only.yml or you could try and work with this [roughly created web config](https://gist.github.com/chamunks/8dda23a752e1e3e92065). Along with this [roughly created data config](https://gist.github.com/chamunks/ee855037b9e77a105ed1).

Like a jerk I didn’t document anything or test anything so YMMV.

**Edit**  
WARNING please keep in mind that if the Redis server is intended to store data long term you may want to verify that this configuration will in fact actually save any data if you rebuild your web\_nosql container.

---

<div class="post-metadata">

### Author: ![nileshtrivedi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nileshtrivedi/32/37212_2.png) [@nileshtrivedi](https://meta.discourse.org/u/nileshtrivedi)
#### Post date: [2015 年 4 月 3 日午前 6:05 UTC](https://meta.discourse.org/t/docker-setup-for-app-and-redis/27110/4 "2015-04-03T06:05:04Z")

</div>

Thanks @chamunks and @riking . I have submitted a pull request here: [Added a sample template web\_redis.yml by nileshtrivedi · Pull Request #141 · discourse/discourse\_docker · GitHub](https://github.com/discourse/discourse_docker/pull/141)

---

<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: [2015 年 4 月 6 日午前 4:42 UTC](https://meta.discourse.org/t/docker-setup-for-app-and-redis/27110/5 "2015-04-06T04:42:46Z")

</div>

Sorry, I can’t support a sample for every permutation possible. Web redis is a VERY odd combo. Instead I would go with web\_only AND redis (both of which exist) which would give you much less downtime when you need to re-bootstrap.

---

<div class="post-metadata">

### Author: ![nileshtrivedi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nileshtrivedi/32/37212_2.png) [@nileshtrivedi](https://meta.discourse.org/u/nileshtrivedi)
#### Post date: [2015 年 4 月 6 日午前 5:17 UTC](https://meta.discourse.org/t/docker-setup-for-app-and-redis/27110/6 "2015-04-06T05:17:19Z")

</div>

@sam Makes sense. How do I go about using web\_only AND redis? Specifically, how do I tell web\_only container which Redis to connect to?

---

<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: [2015 年 4 月 6 日午前 5:27 UTC](https://meta.discourse.org/t/docker-setup-for-app-and-redis/27110/7 "2015-04-06T05:27:46Z")

</div>

Just run a redis host, pull it on to the local ip address and then specify it here:

> <https://github.com/discourse/discourse_docker/blob/master/samples/web_only.yml#L28>
