Docker setup for App and Redis

AI-generated summary

In a discussion about Docker setup for Discourse, nileshtrivedi asked how to create a template combining Discourse and Redis while using an external PostgreSQL database. riking suggested modifying standalone.yml by removing the PostgreSQL template and configuring connection info via environment variables. chamunks recommended extracting Redis settings from data.yml into web_only.yml and provided links to sample configurations, while warning about data persistence risks during container rebuilds. nileshtrivedi thanked the contributors and submitted a pull request with their proposed solution.

However, sam advised against creating a custom sample for this “very odd combo,” suggesting instead to run web_only and a separate Redis container for better stability. When nileshtrivedi asked how to connect the web_only container to an external Redis instance, sam directed them to specify the Redis host in the configuration file at line 28 of web_only.yml.

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.

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

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

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.

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