Docker setup for App and Redis

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?

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

1 Like

@nileshtrivedi I’ve been currently working through this kind of thing myself. If I were in your shoes I’d look at:

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. Along with this roughly created data config.

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.

1 Like

Thanks @chamunks and @riking . I have submitted a pull request here: https://github.com/discourse/discourse_docker/pull/141

3 Likes

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.

2 Likes

@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?

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

2 Likes