For local access you can use 127.0.0.1:80:80 and it won't put a hole in your firewall.
Or if your database is access by another docker container, just put them on the same docker network and access via container name, and you don't need any port mapping at all.