This is a small addition to the previous guide I had created earlier.
The previous guide showed how you can add a iptables firewall that will work with your docker containers, while it may not seem complicated, and really it isn’t, it does take a little bit of reading and understanding for it to “click”, at least it did for me.
What this modification will do is modify your iptables rules to allow a dynamic IP to only be allowed access to your secure services. This may not be ideal for everyone, but for me it works great, since I can set it to my home IP address. This means I can only connect via SSH and the docker service via Portainer.
You may say, how do you connect if you are not at home? Well I just VPN to my home connection and then connect to my secure services.
Also if your looking for a way to securely connect to your docker service remotely, check out this awesome guide.