U
U
user_of_toster2021-12-26 13:58:58
Docker
user_of_toster, 2021-12-26 13:58:58

How to make it possible to connect to containers from the outside?

Let's say I'm using the following setup for local development. Access to db and radish should only be available locally from my pc (docker host), right?

...
services:
     db:
           image: postgres
           ports:
             -  5432:5432
     cache:
           image: redis
           ports:
             - 6379:6379
...


What do I need to do \ what settings do I need to change so that I can connect to the db \ radish (running on my PC) from the outside world? I tried to google, there are some assumptions, but there is no complete picture.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Drno, 2021-12-26
@user_of_toster

External ip
Forward a port to the PC where the docker is spinning
Allow your OS to access the docker ports from the outside (open the firewall there or throw the port through)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question