

You can bind an exposed port to a specific IP by prefixing the IP address like this “-p xxx.xx.x.360:80:80”. Should work in a compose file “ports” list as well.
For outgoing traffic it’s a bit trickier, but if you create a separate network I think it should be possible to inject an iptables SNAT rule to use a specific source IP. Might be handy to make sure you’re sending emails from the correct IP but with your setup I would just make sure to use the primary IP as email egress…


Best option is probably to look for providers that support custom domains, so you can point your domain directly to their mail servers. This usually require a paid subscription. Upside is that you retain control over your domain without having to host any email server.
The problem is that by putting a mail relay in between, while technically possible will break the SPF and DKIM chain for all emails that you forward. I don’t think there is a good way around this since they check against the senders domain (and assuming that you can’t get the email provider to trust your relay server)