Docker and iptables persistence

In this article we will provide instruction on how to get our pre-configured firewall script that sets up Docker to run with Entermedia Database.

 

 

First, enter the appropriate folder (of your choice) and run the following command to download the script from our servers.

wget -O /root/firewall.sh https://raw.githubusercontent.com/entermedia-community/entermediadb-docker/master/scripts/firewall.sh && chmod +x /root/firewall.sh

 

 

Second, we'll be creating reate your own iptables unix service:

sudo vi /etc/systemd/system/org.entermediadb-firewall.service
[Unit]
Description=dam.entermediadb.org Firewall Config
After=docker.service
After=nginx.service
After=firewalld.service

[Service]
Type=oneshot
ExecStart=/root/firewall.sh

[Install]
WantedBy=multi-user.target

 

 

Third, set the enable  the service start at your machine's boot sequence.

systemctl enable --now org.entermediadb-firewall.service

 

And we're done!

 

 

*** Tested on CentOS/RHEL 7.6 && iptables v1.4.21 ***