Score:0

Best practices for running several docker containers on one machine

mm flag

I have recently built a physical server, this is a first for me as I've previously been using VPS's and other cloud-based solutions. I'm currently planning on hosting a few containers on this server:

  • A Minecraft server to play with friends
  • A website under the same hostname

  • An Angular-powered website under a different hostname
  • A Spring backend for that website
  • A Mongo database for the backend

  • Another website under another different hostname

So, there are instantly a few problems that arise:

  • Three containers will try to use port 80 and port 433
  • I would rather not expose the backend and Mongo containers to the web directly
  • Several containers will need to communicate with each other

So one solution I found would be to use a NGINX (or other proxy) container to redirect traffic through. Then I'd have to put the proxy in a network with the to-be exposed frontends. Then one way to do it is to put the angular frontend for the second website in a network with both backend and Mongo database. I could also put the database and the backend in a separate network, so the angular frontend would be connected with the backend only.

The minecraft server is the only one that uses port 25565 and doesn't need to be fed through the proxy.

I want to set this up the best way possible, so my question is what are the best practices for such a setup, should I use as many networks as possible and feed as much as possible through the proxy or would that be overkill? And is there any security risk I overlooked?

djdomi avatar
za flag
Home and Enduser questions are off topic, you may ask on [su]
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.