by vanviegen · 1y ago · 0 comments
## Restrict Host Ports for Security
If app and mariadb are only communicating internally, you can remove 3306:3306 to avoid exposing the port to the host machine:
```yaml ports: - 3306:3306 # Remove this unless external access is required. ```
So, apparently, ChatGPT doesn't need any more convincing.
I don't understand how it gets there though. How does it "know" that's the right thing to suggest when the majority of the online documentation all gets it wrong?
I know how I do it. I read the Docker docs, I see that I don't think publishing that port is needed, I spin up a test, and I verify my theory. AFAIK, ChatGPT isn't testing to verify assumptions like that, so I wonder how it determines correct from incorrect.