I am using Docker on a Linux server with Ubuntu as the operating system. I installed a specific package (devlikeapro/waha-plus) in Docker, which created a website that automates WhatsApp.
I want to restrict access to Docker to only one IP address, so that the entire internet cannot access this site. I want only my server to be able to access the API. How do I do this?
Currently, I am running the Docker container with the following command:
docker run -it --rm -p 3000:3000/tcp --name waha devlikeapro/waha-plus
I tried these things and they didn't work:
sudo ipset create allowed-ip hash:ip
sudo ipset add allowed-ip
sudo iptables -I DOCKER-USER -m set ! --match-set allowed-ip src -j DROP
sudo iptables -A INPUT -p all -s -j ACCEPT
sudo iptables -A INPUT -p all -j DROP
sudo iptables -F
sudo iptables -A INPUT -s -j ACCEPT
sudo iptables -A INPUT -j DROP
sudo iptables-save