Can Nginx (Reverse proxy) and a Game Server Run on the Same Docker Container?

I’m working on a project where I’m considering running both Nginx (as a reverse proxy or for serving static assets) and a game server (Mirror) within the same Docker container. I’m trying to evaluate whether this is a feasible approach and if there are any potential drawbacks or limitations.

Specifically, I’d like to know:

  1. Are there any performance or security concerns with this setup?
  2. Is it better to separate these services into different containers, even if they are part of the same application stack?
  3. Are there best practices for configuring Nginx and a game server to coexist in a single container, especially with respect to networking and resource allocation?

If anyone has experience with a similar configuration or can provide insights into the pros and cons of this approach, I’d greatly appreciate it. Any examples, configurations, or advice would be helpful!

Thanks in advance for your input!

Pretty sure I saw a post about this the other day with a guy with ngix and docker. Depends why you need the reverse proxy

I developed a multiplayer game (WEBGL) using Mirror and want to deploy the dedicated server (Playfab) for this. I am trying from couple of days to setup reverse proxy for HTTPS request. That’s why I need it.

So your game is on http? Im pretty sure thats what the other guy had… You should just be able to set it up, cos the only port you need to expose is the reverse proxy, and it needs to talk to the game which it shares a host with, should be fine

That is the issue I am facing. Setting up reverse proxy for game server.