Building Discourse image from discourse/discourse - how to install plugins

Hi,

Would anyone be able to advise on building a Discourse Docker image that has a number of plugins built in rather than installing via the UI?

Background - we want to utilise the latest Discourse build i.e. discourse:stable and from what I have read in the installation guide and other documentation is that we can take this as a base image in our own Dockerfile and then do something like:

RUN cd /var/www/discourse/plugins && \                                                                                                                           
      git clone https://github.com/discourse/discourse-chat-integration.git 

This would add the discourse-chat-integration plugin into the build. Then at runtime we can pass in all the required environment variables i.e. DISCOURSE_HOSTNAME, DISCOURSE_SMTP_DOMAIN, DISCOURSE_DB_HOST etc rather than having these hardcode in the app.yml file.

If anyone could advise on the above it would be greatly appreciated.

Thanks.

You can’t install plugins from the UI. You install them from the YML file. If you’re using some not-yet-supported container that you didn’t build yourself with launcher, then you’d do something like you suggest.

But that plugin is in core (but maybe not yet in stable?).

They aren’t really hard-coded in the YML file. The yml file is used to build and launch the container. You can build it and then launch it yourself, however you want. You can use ./launcher start-cmd container-name (or something like that, you can look in launcher to see if I got it wrong).

So what I think you want to do is continue to use launcher, add the plugin, ./launcher bootstrap app the container, and then launch it however you want. You can even push it to a repo where you can launch it from some other machine.

yeah, I think there might not be stable anymore, at least not much longer. See RFC: A new versioning strategy for Discourse