Amir Choubani
Amir Choubani

Reputation: 1011

[Docker-compose]: Unable to connect to redis server

I am unable to connect to redis server from redis insight.

version: '3'

services:
  redis:
    image: redis:7-alpine
    restart: always
    ports:
    - "6379:6379"
  redis-insight:
    image: redis/redisinsight:latest
    restart: always
    ports:
    - "5540:5540"
    volumes:
    - redis-insight:/data

volumes:
   redis-insight:

I tried many variations (localhost, 127.0.0.1), but It does not work. Any idea ?

enter image description here

Upvotes: -1

Views: 717

Answers (2)

mallah
mallah

Reputation: 185

redisinsight is run in port 5540 not 8001

Upvotes: 0

Guy Royse
Guy Royse

Reputation: 4312

Redis Insight and Redis are both in Docker. You need to use the Docker network to connect them. So, use the server names instead of the host (i.e. your computer).

In your case, that would mean your host should be redis and the port should be 6379.

Upvotes: 3

Related Questions