SamR1 / docker-fittrackee

GNU General Public License v3.0
13 stars 0 forks source link

Security: db port doesn't need to be exposed in stack #3

Closed sgofferj closed 3 years ago

sgofferj commented 3 years ago

I noticed that in the docker-compose.yml the port of the postgresdb is exposed. When you link the containers as it's done in the compose file, that's not necessary for the app container to access the db. containers inside a stack can (almost) always talk to each other. The only advantage is that it would be possible to use an external app to access the db like pgadmin. From a security point of view, I would argue against exposing the port, at least not in a production environment.

SamR1 commented 3 years ago

thanks for your feedback, I updated docker-compose.yml file