Hi guys, I was wondering how you manage calls to d...
# docker
m
Hi guys, I was wondering how you manage calls to different applications on your local machine? I'm trying to access a local keycloak instance which is running at
localhost:8080
. The problem is that when I'm trying to access anything from within Spryker that runs on localhost I get an error that the host refused to open a port. I know that docker-compose ships with an option in the
extra_hosts
called
host-gateway
that will allow you to map a domain to your local environment outside of docker. It doesn't look like the docker/sdk from Spryker doesn't really support this out of the box. (At least judging by the deploy file reference). Whats your solutions for these problems? And does anyone know if there are plans for Sprykers docker/sdk to support the
extra_hosts
entry any time soon?
a
Hi Lukas, you can try to call http://host.docker.internal:8080 - host.docker.internal resolves to your host system from within the docker container where spryker is running.
a
Hi Lukas, I typically solve these situations by running the service (in your case keycloak) in a container on the same docker engine and then resolving it by name via docker, not by port. I.e. sth. like
Copy code
docker run -d --name keycloak --network <your spryker docker-network, e.g. "b2c_private"> <keycloak-image>

# test connection in spryker-container (e.g. cli, which is connected to "b2c_private")
curl <http://keycloak>[:<internal keycloak-port>]