Skip to content Skip to sidebar Skip to footer

Connect To Redis From Another Container In Docker

I have app, that used Tornado and tornado-redis. [image 'app' in docker images] I start redis: docker run --name some-redis -d redis Then I want to link my app with redis: docker

Solution 1:

tornadoredis attempts to use redis on localhost. (See source here)

So you need to inform tornadoredis where redis is running (since to the docker image it is not running on localhost).

For example:

c = tornadoredis.Client(host="<hostname>")
c.connect()

In your specific case, substitute "redis" for "<hostname>".

Post a Comment for "Connect To Redis From Another Container In Docker"