Lightsail container communication

0

I currently have a Lightsail container service deployment with two containers. One container needs to make a server-side http call (a Python request) to the other container, which is running a REST api. This works fine locally with docker compose but the connection is refused in the Lightsail deployment.

The Lightsail docs here seems to indicate this is possible by using the private domain and the open port of the container. ie For container service foo, and a container within that service listening on port 6000, you should be able to access that container within the private domain at foo.service.local:6000. This is what I tried leading to the connection refused error.

But there is also a section here that says to open communications via environment variable. I don't quite understand this. Does anyone have examples of this?

Any help with either method to get communication between containers working would be appreciated.

Ryan
feita há 9 meses389 visualizações
2 Respostas
0

Hello.
Is it possible to communicate when accessing with "localhost:6000"?

profile picture
ESPECIALISTA
respondido há 9 meses
0

The problem I had is actually with the service within the container (was unresponsive), not the inter-container communication. I sanity tested with a different viable service and was able to reach from one container to another using the private domain as stated in the documentation.

Just to be clear, for a deployment foo with two containers A and B, with container B listening on port 6000, A is able to make http requests to B using host foo.service.local:6000.

Ryan
respondido há 9 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas