Serve different django apps on different ports

Hi, I have a case where I need to expose a healthcheck endpoint over one port e.g. 8001, and the application itself over another e.g. 8000. The django application is running inside a docker container, and it needs to be inside one container; meaning there can be running two different django applications, or different apps within one django application.
What would a solution look like?
Thank you!

I’m having a difficult time understanding what you’re hoping to achieve by this in the manner you’ve described.

If I had to do something like this, I’d have two docker containers, each running under uwsgi (gunicorn would be just as good) with different settings files. The two settings files would each refer to a different root url file, enforcing the segregation of usage between the two instances. Both of these would sit behind an nginx instance, with access identified by any of the available means.

Thank you for the help @KenWhitesell,
In any normal circumstances, I would too; but, this is a requirement from an internal platform on my company. I can only run the django application/s inside only one docker container. And, I have to expose two ports, one for the healthcheck and the other the application itself which will be exposed globally to the internet.
I want to achieve something like a multi-service container with django.
Thanks!

But that can be managed (and is better managed) by your webserver instead of your container. Let nginx manage those restrictions for you.

I’m constrained by the requirements of the in-house platform offering. I understand and absolutely agree with you that nginx and a multi-container is the solution. But, given the constraints, I have to use a single container to achieve that :sweat_smile:. Any suggestions on how to achieve that? Thank you!