You might be interested in ufw-docker: https://github.com/chaifeng/ufw-docker