It’s really simple…
Each application has its own shared volume and that volume is where the unix domain socket runs (and where all the other persistent data is like the uploads, etc.)
You do not need to work with docker-compose directly, special pup directives, or change anything at all (only set up the basic yml files correctly for the containers, and run launcher).
If one of your Discourse sites / apps is called “farmer_forums”, then your unix socket is located (by default), for example:
If your next Discourse site / app is “race_car_forums”, then your unix socket is (for example) here:
You can do this for 100s of forums, if you wish; and each one is just an entry in a reverse proxy to that socket. Just name your container yml files appropriately.
Each one of those forums will have their own data container as well. You can use any naming convention you like for those containers for example
Of course, each one of those will have their own shared volume for their database(s).
All you need to do is to create one working “two container solution” and replicate it behind a reverse proxy. Creating one site, or 100 sites, it is all the same if you follow this simple method.
PS: I have heard (read) some people try to have one database container for many different forums. I would never recommend that, personally. That configuration creates a single point of failure for all forums and is not how I like to do things “keep it simple and stupid” (KISS). But, I like KISS in sys admin, because I have fat fingered things over the decades more than once and so I don’t like breaking more than I have too when I make a mistake (which we all do, from time to time).
So, if you are struggling with this; just get one site up and running with two containers, the app and the data container, behind a reverse proxy.
Then just replicate that, as many times as you want, with an app and a data container for each site. All your container names must be unique and should follow some easy to remember naming convention like in the farmers and race car samples above.
I’m not trying to sound repetitive nor preachy., but it is almost trivial to set up many Discourse sites behind a reverse proxy in this manner.
Hope this further explanation helps, in some small way.
In a nutshell, for me “multisite” simply means doing the “two container” solution behind a reverse proxy, multiple times, as many times as you wish! One or ten, it’s all the same configuration, basically, only the names of the containers are different, and there is some “easy to understand” container naming configuration (like in the two examples above). Docker will share the libs and overlays appropriately between images, so there is “nothing to do here” because “that is what docker does” (sets up all the shared libs, builds the docker network, etc) all by itself, which makes this “efficient” due to how docker shares libs, between images, etc.