Install the docker version with a remote postgresql

AI-generated summary

Bertrand_Bellenot sought guidance on installing the Docker version of Discourse with a remote PostgreSQL server, specifically one where he lacks superuser permissions Bertrand_Bellenot. Initially, codinghorror expressed doubt that installation was possible without superuser access. However, mpalmer clarified that superuser rights are only required to create the database and role; once those are established by IT, a regular user can complete the setup. mpalmer successfully tested this approach and subsequently published a detailed how-to guide this new, shiny howto mpalmer. Bertrand_Bellenot confirmed the solution worked Bertrand_Bellenot. Later, he asked if specific environment variables in web.template.yml needed manual modification to point to the remote instance Bertrand_Bellenot. sam explained that configurations in app.yml override the templates, making such manual edits unnecessary. Bertrand_Bellenot concluded the discussion by confirming a successful migration from phpBB to Discourse Bertrand_Bellenot.

Hello,

We are migrating our phpbb3 forum to discourse (yeah!)
So I’m trying to install (configure) a standard discourse (docker version) with a remote postgresql server (centrally provided by IT, for which I don’t have superuser permission)
Is there a simple explanation (or a concrete example) how to do it?
Thanks in advance!

Cheers, Bertrand.

Unfortunately I don’t think it will be possible to install Discourse without super user account in Postgres.

Hmm, I dunno… the only thing you should need superuser for is to create the DB and role; from there, the regular user can do everything. So if Central IT (all praise the glorious Leader!) do those bits, and the config in app.yml is setup with the correct creds, surely it’d work OK?

/me gives it a go

OK, that worked well enough (for the most part). I’ll write up a howto topic and link it from here, since there are a few steps to making it work right.

Give this new, shiny howto a go, and post in that topic if you’ve got any problems.

Thank you very much everybody, I will give it a try and let you know.

Cheers, Bertrand.

Hi Matt,

It seems to work! Thank you very much! :grinning:
I’ll post again if something goes wrong with the DB…

Cheers, Bertrand.

Do we have to modify the web.template.yml file?
In particular this part:

env:
  # You can have redis on a different box
  RAILS_ENV: 'production'
  UNICORN_WORKERS: 3
  UNICORN_SIDEKIQS: 1
  # this gives us very good cache coverage, 96 -> 99
  # in practice it is 1-2% perf improvement
  RUBY_GLOBAL_METHOD_CACHE_SIZE: 131072
  # stop heap doubling in size so aggressively, this conserves memory
  RUBY_GC_HEAP_GROWTH_MAX_SLOTS: 40000
  RUBY_GC_HEAP_INIT_SLOTS: 400000
  RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR: 1.5

  DISCOURSE_DB_SOCKET: /var/run/postgresql
  DISCOURSE_DB_HOST:
  DISCOURSE_DB_PORT:

Shouldn’t this also point to our remote postgresql instance?
(same question for any other configuration file…)

Not really , everything in ‘app.yml’ overrides the templates it mixes in

OK, thanks! And BTW, I really love Discourse! :slight_smile:
Thanks to your help, we finally migrated from our phpBB forum to Discourse (today) :slight_smile:

Cheers, Bertrand.