Custom Node containered application can't connect to Redis

I have a Node app which uses Redis for session store but I’m unable to get this connected to the OpenVidu containered Redis. I’m using 2.15 and have Googled to find out how to connect to a containered Redis and it doesn’t work (change the host in the Node client to “redis”). I’ve also tried adding the new password to the client in my Node App to try and connect with this.

I don’t have enough knowledge of Docker to understand why the two apps which both have network status set as “host” in docker compose can’t connect?

My workaround at the moment is to run a normal redis-server on a different port and have the Node App connect to it.

Redis database included in OpenVidu listen in localhost (because network=“host”). So you can use localhost as the host and standard redis port. Take into account that redis is secured with a password.

Regards

Ok Thanks. Looks like I did something wrong. Tried it again but this time using “localhost” and you are right it it works. It is possible that in making the changes I didn’t rebuild the Node docker image. Sorry if I wasted your time.

1 Like