I'm running Redis via docker-compose and redis-insights for getting a UI.
Redis-Insight asks for a "Logical Name of the redis database" as a mandatory text field.
I tried things like "0", "1", "db0", "db1", "@0" but nothing will be accepted, although Redis can be used properly by my application via redis://127.0.0.1:6389
.
This is my docker-compose.yml:
version: '3.5'
services:
redis:
image: redis:latest
restart: always
ports:
- '6389:6379'
expose:
- 6389
command: redis-server --save 20 1 --loglevel warning
volumes:
- redis:/data
cache-redis-insight:
image: redislabs/redisinsight:latest
ports:
- '8001:8001'
Logical name is not the issue, thats just some name so you can identify which database you're connecting to, it doesnt exist on the redis server.
The actual problem is that redisinsight
needs to connect to redis from inside its container while only your host can access localhost:6389
From inside the docker network your redisinsight
container can connect to redis on redis:6379
. I just ran docker compose up
and it works, Ill attach some pics.