i am using redis stack as a docker image. the redis is connecting to the cli but the redis insight is not opening on the browser.
As far as i’ve searched the internet the solution for this is to change the port number in the docker run command. I’ve also tried that but still its not working.
2
Answers
I have this docker-compose and I am not able to access the redis-insight
and If I remove the
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
line , it worked but I want the redis.conf to run for persistent data
I came across the same problem. I am also using the redis-stack as a docker image. I can connect to Redis via redis-cli but unfortunately Redis Insight cannot be accessed, nor on port 8001 or 5540 as documentation tells. I found a solution, that worked for me:
My docker compose was like this:
version: "3" services: redis: image: redis/redis-stack:latest container_name: redis hostname: redis restart: unless-stopped mem_limit: 1g cpu_shares: 1024 command: ["redis-server", "/usr/local/etc/redis/redis.conf"] healthcheck: test: ["CMD-SHELL", "redis-cli ping || exit 1"] network_mode: host volumes: - redis_data:/data - /PWD/redis/redis.conf:/usr/local/etc/redis/redis.conf volumes: redis_data:
The problem was in the command itself building the container with the instruction to (only) start the redis-server and not the entire redis-stack. The default command is to start the entire stack, including Insight. Therefore, the command can be omitted. The working docker compose looks like this. The configuration as prescribed in the redis.conf file is included in the boot of the container. No need to separately include it in the command.
version: "3" services: redis: image: redis/redis-stack:latest container_name: redis hostname: redis restart: unless-stopped mem_limit: 1g cpu_shares: 1024 healthcheck: test: ["CMD-SHELL", "redis-cli ping || exit 1"] network_mode: host volumes: - redis_data:/data - /PWD/redis/redis.conf:/usr/local/etc/redis/redis.conf volumes: redis_data: