On a client project, I opened a PR to add Redis to our local Docker dev environment.
My first instinct was to keep the service private because our app already talks to it on the internal network.
Anticipating the need to justify that choice, I added a comment in the pull request that you could still run redis-cli
inside the container if we needed to occasionally inspect Redis data manually.
Despite my pre-emptive comment, Aaron still pushed back.
He didn't see the need to limit ourselves to a command-line tool when a more usable GUI (like TablePlus or PhpStorm) would help us debug faster. I was being overly stingy by not exposing the port. It's not like this was going into a staging or production environment. This is only for local development.
I saw his point and updated the PR to expose the port after all.
The lesson is simple. Unless you have a specific need to hide that port, and even if you won't use it that frequently, why not make the occasional debug session easier?
Your teammates, and probably also your future self, will appreciate the options.
Here to help,
Joel
P.S. Struggling with your local Docker setup, or wanting to try it out? We can help you set that up.