I’m an engineer at Compose/IBM and I’m attempting to setup Discourse using our production-ready, replicated databases. I’d like to run a web_only instance with external Redis & PostgreSQL
I also couldn’t find configuration parameters for failover support:
We supply two URIs “portals” for connection failover. I don’t have a ton of time to dig through the Discourse codebase and see which client driver you are using.
Lastly, we use SSL (using valid LE certs) for both Redis and PostgreSQL. Is your app configured for SSL support?
Thanks!
P.S. I’m reaching out personally, not officially from IBM/Compose. I enjoy Discourse and have been considering writing an article on how to configure Discourse using our services:
You can see all of the possible global vars documented at:
You can pass in config from your environment, all the settings below are available.
Append DISCOURSE_ and upper case the setting in ENV. For example:
to pass in db_timeout of 200 you would use DISCOURSE_DB_TIMEOUT=200
I’m doing this for a docker-compose application, and despite exporting the environment variable for DISCOURSE_REDIS_HOST (as redis) it is not honoring this variable:
name, 'name', name),\n updated_at,\n created_at,\n updated_at\nFROM facebook_user_infos\n")
discourse_1_9cc0cea436ca | rake aborted!
discourse_1_9cc0cea436ca | Redis::CannotConnectError: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)
discourse_1_9cc0cea436ca | /usr/local/bundle/gems/redis-4.0.1/lib/redis/client.rb:344:in `rescue in establish_connection'
My complete code is here if you want to inspect. For some reason, the variables (that should be honored) are not. For context, I’m really wanting to help with a plugin but the barriers to entry (setting up a basic development environment without installing everything on my host!) are huge. The only time I’ve ever gotten discourse working was using the bitnami image, which I’ve been told (somewhere else) isn’t the right way to go about it. Please help - this shouldn’t be this hard, especially to give my free time because I want to help
I’m running it with production as the environment variable, and it wasn’t being honored. As a workaround I changed the config with sed, and that fixed it. There are still numerous other issues I’m working on.
Why can’t I run a production environment and use it for development? And what does sidekiq do? Should that be run alone to start the application? E.g., I have another container (same base) with a start command:
bundle exec sidekiq
And it depends on the main discourse container (migrating the db, precompiling static, etc.). Everything seems to work, but there is no web application.
I’m happy to spend lots of (more) time on this, granted that I haven’t started anything yet, but I need a solution that doesn’t require me installing a database on my host. With containers, we shouldn’t need to do that. And again, the compose application here https://github.com/vsoch/discourse-compose seems to be working (no errors in any logs) yet there is no application.
Okay I gave in and ran the --init command. I can confirm the container is running:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d2254e1374f5 discourse/discourse_dev:release "/sbin/boot" 24 minutes ago Up 24 minutes 0.0.0.0:1080->1080/tcp, 0.0.0.0:3000->3000/tcp, 0.0.0.0:9292->9292/tcp, 0.0.0.0:9405->9405/tcp discourse_dev
But I’m not seeing any record of it at any port. I’ve tried two browsers, localhost, 127.0.0.1, and 0.0.0.0 and there is no web application. The error is ERR_CONNECTION_RESET. I don’t see anything in iptables that would block this:
Thanks for everyone’s help - the issue was needing to issue that “unicorn” command, and I now have everything working. I also had to run rake admin:create in the start command, otherwise it wants an email confirmation (full repo here). The discourse_dev works too.