I have an App built on Laravel. I'm using Laradock and I'm trying to use Redis container, but I have a problem with connection.
With the command:
docker inspect laradock_redis_1
I can see that: "IPAddress": "172.22.0.2",
By In my frontend I'm trying to connect to Redis with ioredis:
import Redis from 'ioredis';
const redis = new Redis({
port: 6379,
host: 172.22.0.2,
password: "password"
});
redis.on('pmessage', function(subscribed, channel, message) {
...
})
But I can't connect because I get this error:
[ioredis] Unhandled error event: Error: connect ETIMEDOUT
I'm trying also with change ip and port like:
port: 6379,
host: 127.0.0.1,
Or changing the port on docker-compose with 1111 but it doesn't work yet. What am I doing wrong?