Running Discourse on Docker for Mac

Here’s the PR :wink:

I know; I too have spent too much time debugging docker-sync than I care to admit. This new approach, albeit not as fast, requires zero additional effort to setup and is quite stable from my own experiences!

9 Likes

I finally installed Discourse on my Mac… but it is hell to slow…like I’m taking super slow (20 sec a page).
So my question:

  1. Is this a docker issue or a discourse code issue?

Anyone having the same issue?

1 Like

It’s a Docker for Mac issue. Setting up Discourse natively on your Mac for development will improve performace drastically.

2 Likes

Maybe Discourse shouldn’t use Docker at all? I do not see the advantage. Seriously it’s just an extra layer and debugging containers will become a pain. Just saying.

Docker standardises the environment around the running app and sandboxes it from the host.

It would be a nightmare for the Discourse team to support self-hosted installations without Docker, as the host environment and config would vary wildly between Discourse instances - particularly between Mac and Linux for example.

Docker results in a small performance hit in Linux (admittedly larger on Mac) but the advantages are huge for a open-source project like this with a distributed development team and thousands of self-hosted instances.

If you want to run an app at any kind of commercial scale (e.g, using Kubernetes for cluster orchestration), you need to containerise your app in order to abstract all the implementation details away from the orchestrator.

1 Like

I don’t use Docker in my dev environment (albeit on Ubuntu). It’s actually probably more work to do it the way I do it as it’s a pain to rebuild from scratch.

Back at you @cmoi,

Just installed a new setup, for dev, on my mac (for development, see post #44 above) and it is very fast. No problems at all.

Regarding your other question

@cmoi says…
Maybe Discourse shouldn’t use Docker at all? I do not see the advantage. Seriously it’s just an extra layer and debugging containers will become a pain. Just saying

We run discourse in docker in production and staging, and it is great. One reason is that it takes a fraction of the time and effort to set up in docker than it does “on the metal”. It is also much easier to restore in the event of a server crash in docker.

So, there are many reasons to run in docker (in production), without question.

However, for plugin development, I finally switched to a “bare metal” setup without docker and I can see already that loading and reloading plugins, debugging and all that fun stuff is going to be much faster and more fun, outside of docker, for sure.