Can I move discourse out of the default docker bridge network?

AI-generated summary

tophee is seeking to move their Discourse instance from the default Docker bridge network to a custom network. pfaffman suggests adding a docker-args stanza with the custom network name, such as --network web. tophee is concerned about potential issues, but pfaffman confirms that this setup works fine with their Traefik config. Additionally, pfaffman notes that using websockets with an outer proxy may render the network change unnecessary, as sockets are not affected by Docker networks.

When following the default discourse install process, discourse will run on the default docker bridge network. Is it safe to move it into a custom network without any problems and if so, how do I do it so that it persists across rebuilds?

I think all you need to do is add a docker-args stanza with the stuff you want, something like

docker_args: |
  --network web

I put it after links in my setup.

So you did switch the network and everything works find? That would be great!

That said: it occurred to me just a few minutes ago that I may not even need to change the network since I’m using the websocket with an outer proxy. Is my hunch correct that the websocket circumvents the docker network anyway?

Yes. My traefik config uses this and it works fine.

Yeah. I’m pretty sure that sockets don’t care about docker networks.