Answer the question
In order to leave comments, you need to log in
Is it possible to declare a service container for Docker that will listen on a specific port only if no other containers are listening on it?
The task is next.
I really need to elegantly make a "service being served" page and return it in cases where the container with the main service is stopped. At the same time, I would like not to have to start and stop an additional container for this.
For example
"Container A" is nginx serving the application.
"Container B" - nginx, which stupidly returns "maintenancepage.html".
I would like (without kubernetes) that "Container B" listens to port 443 and 80 of the machine in the event that "Container A" does not listen to these ports (i.e. if "Container A" is down).
For some reason I feel like it should be possible. I searched the dock - I did not find it, I decided to ask the community.
Thanks in advance!
PS. Probably it is necessary to dissolve everything on nginx. For example, using the same `upstream` https://nginx.org/ru/docs/http/ngx_http_upstream_m...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question