Discourse
Updated 6 August 2019
Introduction
Discourse is an open source Internet forum and mailing list management tool.
Note
A customizable Docker container uses ports 80 and 443. If you are not installing Discourse in a separate LXC container, make sure that these ports are not used by any other software.
Preparing a LXС container
We recommend that you install Discourse in a separate container and configure it according to the manual.
Installing Discourse in a Docker container
Install Docker:
emerge app-emulation/docker
Launch Docker and add it to autostart:
/etc/init.d/docker start
rc-update add docker
To get a Docker image, copy the source code first:
mkdir /var/discourse
git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse
Ports 80 and 443 are free for use 'samples/standalone.yml' -> 'containers/app.yml' Found 134GB of memory and 8 physical CPU cores setting db_shared_buffers = 4096MB setting UNICORN_WORKERS = 8 containers/app.yml memory parameters updated. Hostname for your Discourse? [discourse.example.com]: discourse.example.org Email address for admin account(s)? [me@example.com,you@example.com]: admin@example.org SMTP server address? [smtp.example.com]: mail.example.org SMTP port? [587]: 25 SMTP user name? [user@example.com]: '' SMTP password? [pa$$word]: '' Optional email address for setting up Let's Encrypt? (ENTER to skip) [me@example.com]: Does this look right? Hostname : discourse.example.org Email : admin@example.org SMTP address : mail.example.org SMTP port : 25 SMTP username : '' SMTP password : '' ENTER to continue, 'n' to try again, Ctrl+C to exit: Configuration file at updated successfully! DISCOURSE_SMTP_USER_NAME not present DISCOURSE_SMTP_PASSWORD left at incorrect default of Sorry, these containers/app.yml settings aren't valid -- can't continue! If you have unusual requirements, edit containers/app.yml and then: ./launcher bootstrap app
Edit app.yml for the mail server login and password not to be used:
containers/app.yml
DISCOURSE_SMTP_USER_NAME: '' DISCOURSE_SMTP_PASSWORD: ''
Enable the SSL certificate:
containers/app.yml
templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
- "templates/web.ratelimited.template.yml"
- "templates/web.ssl.template.yml"
Launch the process:
./launcher bootstrap app
Getting the Let's Encrypt certificate
Get a discourse.example.org certificate according to the manual.
Copy the SSL certificate and the key to be used in the container:
cp fullchain.pem /var/discourse/shared/standalone/ssl/ssl.crt
cp privkey.pem /var/discourse/shared/standalone/ssl/ssl.key
Launch the Discourse container:
./launcher start app
Open https://discourse.example.org in your browser to complete the configuration process.
Updating Discourse
Update the source code to obtain the Docker image:
cd /var/discourse
git pull
Rebuild the container with Discourse:
./launcher rebuild app
Warning
Note that rebuilding the container will take a while, during which time the Discourse forum will be unavailable.