Redirect 'host-based' requests to a port (inside a docker container)
- by Disco
I'm trying to achieve this fun project of having multiple 'postfix/dovecot' instances inside a docker container.
I'm searching for 'something' that would redirect any incoming request on port 25 (any maybe later 143, 993) to the right container on a different port.
Here's the idea :
+-------+ +----------+
(internet)----(port 25) |mainbox| ---- (port 52032) |container1| (postfix)
+-------+ | +----------+
\ (port 52033) +----------+
|container2| (postfix)
+----------+
So the idea is to 'redirect' requests coming to port 25 and based on 'hostname' to forward to the right port (internally); ideally, it would be great to manage this 'mapping' with a database/textfile
Any ideas ? Directions ?