Why I ditched my custom discourse install, and went with the easy option


(James Cook) #1

When discovering Discourse and reading the beginners install guide, my immediate thought was ‘What if I want to customise Discourse for my own needs?’.

This frame of mind stayed with me, and I immediately started looking at how I could run multiple containers and use my own Docker image etc. I know a lot of you are in the same boat, and I wanted to create this topic to explain why i think this is unnecessary for 95% of people using Discourse, including me.

Private, customised, closed off Discourse :smiling_imp:

When I still wanted my own customised Discourse installation I initially started by making a copy of the Discourse repo, renaming it and making it a private repo in my own github account. I explain how I did this here: Best way to setup a private customised discourse repo.

I then set about customising the discourse-docker repo to fit my needs. This included making changes to the templates to take into account the difference in folder names and system user, telling launcher to use my docker image instead of the discourse one and configuring ssh keys so that my server could clone my private repo.

I then created multiple containers using the included data and web_only container samples in discourse-docker and used the link feature in Docker to get them talking nicely without exposing ports, see here.

This was all done just in case I wanted more control and flexibility further down the road.

And you know what? It was a pain in the butt to do all of this configuration. I couldn’t even use the automatic updater without doing some more work and I had the added overhead of managing a Dockerfile. It also meant that every time new features and cool stuff were added to Discourse, I would have to manually merge these in to my repo and rebuild my app. :sob:

Why I wanted multiple Docker containers, and what changed my mind.

I was always under the impression that it could be dangerous to run a database inside a Docker container. What if the container was destroyed? I’d lose all my data right? This thinking led me to want my web application separate from my data so I could mess around with my app and rebuild it without worrying that I’d end up destroying my database.

However, the way the discourse-docker project has been written, means that your data is kept outside of the container when it’s built. Something I only realised last week after trying to destroy my data and failing numerous times! @sam explained this to me in this topic.

So if your data is safe, and you really don’t need to be tweaking postgres and redis all the time, what’s the point in having everything separate? I couldn’t think of one, and so I decided to go back to the supplied all in one solution, which does seem incredibly simple now! :thumbsup:

I saw the light, and it’s open-source :angel:

So I made the decision to go back to one container, but what convinced me to ditch my private repo and just use the main Discourse one?

After using Discourse for a bit and playing around with some of the settings I realised just how customisable it is. Plugins and the sheer speed of development on the project completely negated the need for me to have my own private closed off repo. Any feature development or slight tweaks that I may have done with my own private repo could never match up to the vast amount of open source work being done on the main Discourse project. I realised it would save me a lot of time, a lot of pain and encourage me to open source everything I built if I just used the main Discourse repo with the main discourse-docker launcher. Any changes that I may or may not eventually get round to making, I could just submit a PR for.

Keep it simple, stupid

So after a long journey of discovery with Discourse I just have to reiterate what @codinghorror and @sam have said previously. Everything has already been created to ensure that Discourse is easy to install, easy to upgrade, easy to customise and easy to use. All you have to do is follow the beginners installation guide.

p.s Importing from another forum…

The documentation on this is somewhat spread all over the place, so if this is your main aim, and you’re struggling to figure this out, keep checking back here as I will be shortly writing a Beginner’s Guide to Importing Your Forum Data to Discourse.

(Allen - Watchman Monitoring) #2

I was in a similar place, and made a similar choice… I just run vanilla, and edit the /config/locales/server.en.yml in between the git-reset and the time it takes the app to restart after an upgrade. (there isn’t much I need to change, mostly language in various emails users get sent)

(Erlend Sogge Heggen) #3

Great post.

Oh that would be lovely

(James Cook) #4

This is an interesting blog post from one of the New Relic developers about how to extend and customise Discourse the right way.