Additionally, you can expose ports to localhost only. This way you can still connect to the data container via SSH but only from your server (again, without exposing the database to the internet).
How to:
- Edit your
data.ymlfile adding the localhost on theexposesection for port 22:expose:
# - “5432:5432”
# - “6379:6379”- “127.0.0.1:2221:22”
![]()