Git clone /var/discourse mandatory? Install as non-root possible?

AI-generated summary

The official install guide for Discourse recommends cloning the repository to /var/discourse, but this is not mandatory. According to Falco, users can clone the repository to a different directory, but they will need to adjust paths in some places, such as the mounts in the app.yml file.

Additionally, while the install guide suggests running as root, it is possible to install and run Discourse without root privileges, provided the user is part of the Docker group. However, this may result in some checks failing, such as the DNS readiness check, and users will need to manually configure a swap file if needed.

Falco also notes that using a reverse proxy is supported, and Discourse ships with a template that allows it to listen on a Unix socket, which can be pointed to by the reverse proxy. However, users will need to carefully configure the reverse proxy to send correct headers, handle redirects, and avoid buffering responses.

AntiMetaman confirms that installing in a different directory is possible, and notes that users will need to update the nginx.conf files in addition to the app.yml file.

The install guide asks you to clone the repository to /var/discourse. Is there anything, which depends on it, or can I clone the repo to a totally different directory and have no problem with any part of discourse not finding the tools (not counting myself to replace the directory mentioning /var/discourse to the choice of my directory)?

And requiring to be root seems to be a bit too much: is being part of the docker group enough?

How about if I would like to serve discourse at a port above 1024 and have an nginx or haproxy or whatever to wire that to the “usual” ports (80/443)? Is that possible?

thanks

The install guide is aimed at non-technical people who just want a cheaply hosted Discourse forums, so our launcher script and other tools have a bunch of safe defaults to make their lives easier.

You can use another folder, but will have to adjust paths in some places, like the mounts on the app.yml file. You can run without being root and being on the docker group, but that means that our script won’t be able to automatically create a swap file if needed. Other checks may also fail, like our DNS readyness check. Using a reverse proxy of your choosing is also completely supported, we even ship a template so Discourse will be listening on a unix socket that you can point the reverse proxy to, but this means you should carefully configure the reverse proxy properly, sending correct headers, doing redirects, not buffering responses, etc.

TL;DR Everything is possible as long as you are cool with hacking around on the install.

I installed in another directory. Other than the app.yml you have the nginx.conf files. Then it should be good.