Eh…
The script doesn’t even need access to /var/discourse
(why it does?!).
The whole problem stems from a couple of things:
- huge misunderstanding what docker it, how it works and what it enables
- glueing together the notion that docker = docker-compsose (it’s not!)
You can have completely contained setup that virtually doesn’t touch the host environment…
After doing quite a lot of digging in it seems that the whole “setup” script was created to make installation as simple-as-possible for the very-non-technical-person. It checks, guides the user and setups everything. That may be a nice thing, but it breaks completely in anything that tries to stray even the tiniest inch from the envisioned path.
In the most basic setup, you may not even need to access to any host directories - everything will be contained within limited environment (image will be used to create the container and all the required storage would be handle via docker volumes [it has issues where you want to migrate somewhere else or access the files but we are talking about basics]).
It also tries to make sure that DNS is correct, tries to setup certs, reverse proxy, SMTP and whatnot - again, completely fine to provide this easy setup.
BUT!
The issue is NOT about throwing that away but IN ADDITION providing plain docker image (it’s already there, it’s used by the scripts and templates used by the script! discourse_docker/templates/postgres.template.yml at main · discourse/discourse_docker · GitHub & discourse_docker/launcher at main · discourse/discourse_docker · GitHub) with
- proper versioning: you tag the image with the released discourse version (3.4.5 or whatnot)
- sane, simple documentation of the expected environment variables (driving database/redis/etc connectivity) and possible paths/volumes that can be mounted to host.
Just that…
Take a look at aforementioned miniflux guide: Miniflux Installation with Docker - it gives you details about the image (and which repositories serves them) and possible environment variables to configure it.
Or MySQL docker image: https://hub.docker.com/_/mysql - same thing - guide that expains what is possbile to configure (see especially section: " Environment Variables").
Noone says: “you have to use mysql launcher to build mysql image so you can use it”, or redis for that matter - in this case you simply use existing images and this is the clue and gist of using docker. Yet in case of discourse suddently this is “bad” solution and everyone shouts: “you have to build your own image!” – why!?