I’ve tried to find the answer to this in so many places, and gotten so many different suggestions and replies, so let’s go for the Jackpot and ask here
What I’d like to do is to setup two Docker containers (in this case Synapse) on the same VPS. On that VPS, things like database, MTA (Postfix), and other nice things are already running. I don’t want to duplicate these inside each container; part due to maintenance, part due to resources.
But it seems near impossible (for me) to get this working smoothly. So I’m either doing something wrong, or it’s not doable (which doesn’t sound right to me).
Can someone explain to me if this a) is possible, and if so, b) possibly point me in the right direction as far as Docker networking is concerned, which I’m guessing is issue at hand here.
You can access services on the host by using the host IP as you would on any server. Or if you want to access services listening on a loopback IP only
But we had another (I believe) similar topic where @meyay explained what the recommended solution would be. You don’t need t duplicate, especially not in every container since every container should run a single main process which can create more.But in the long term, you can try to run the other services in containers too. Depending on those services of course.