Docker: installation and concrete use on Ubuntu

Installing Discourse with Docker

In this second example of installing a Docker image, we will see how to install the Discourse image which is a forum and which uses almost the same server components such as:

  • PostgreSQL
  • Ruby
  • Redis

After this installation on the same server, we will have two completely independent applications with certain “duplicate” components and without conflict.

On one server, the same server, the cohabitation of Discourse and Gitlab is not easy to do, even impossible, in fact I have not tried.

For the installation of Discourse, I will not go into detail as with Gitlab, because a container management “utility” is provided.

On the server, create a folder for Discourse:

sudo mkdir /var/discourse/

Clone the git repository in the folder:

sudo git clone https://github.com/discourse/discourse_docker.git /var/discourse/

The configuration of Discourse and the container is done using a file, copy the standalone.yml example file in the containers folder by naming it app.yml

sudo cp /var/discourse/samples/standalone.yml /var/discourse/containers/app.yml

Edit the app.yml file using nano

sudo nano /var/discourse/containers/app.yml

In the file, configure the expose section, indicating the ports for http / https.

expose:
  - "32080:80"   # http
  - "32443:443" # https

Configure the following environment variables:

DISCOURSE_HOSTNAME: 'discourse.rdr-it.local'
DISCOURSE_DEVELOPER_EMAILS: '[email protected],[email protected]'

Configuring a valid SMTP server is “mandatory”.

Then save the file.

If not, go to the folder /var/discourse/.

Start the generation of the container image:

sudo ./launcher bootstrap app

Wait while downloading and configuring the image.

Now start the container with the command:

sudo./launcher start app

Check correct operation with the command:

sudo docker ps

In Cockpit, we can also see the two containers:

As for Girtlab, we will create a virtualhost, as we have seen above, I will only put the virtualhost configuration here.

Once the virtualhost is configured, launch a browser and go to the configured url.

Discourse is installed and functional.

As with Gitlab, it is possible to generate a Let’s Encrypts SSL certificate.

As for Gitlab to avoid mixed content problems, you must force SSL in the configuration of Discourse




Leave a Comment