ubuntu 18.04 server ufw is not blocking even after configuring DOCKER_OPTS="iptables=false"

Viewed 362

i have been trying all the solutions i found to block incoming traffic to port 5432 but with no success. there is an issue with docker skipping ufw and it has been advised to configure DOCKER_OPTS="iptables=false" in /etc/default/docker, i have done that too but still it's not working. can you please help.

1 Answers

In case you don't want to expose your Postgresql to the internet you can map to only localhost in docker-compose.yml

  db:
    image: postgres
    ports:
      - '127.0.0.1:5432:5432'
Related