If you have your own firewall rules, docker just writes its own around them.
That option has nothing to do with the problem at hand.
https://docs.docker.com/reference/compose-file/networks/#ext...
$ nc 127.0.0.1 5432 && echo success || echo no success no success
Example snippet from docker-compose:
DB/cache (e.g. Postgres & Redis, in this example Postgres):
[..]
ports:
- "5432:5432"
networks:
- backend
[..]
App: [..]
networks:
- backend
- frontend
[..]
networks:
frontend:
external: true
backend:
internal: true