Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Redis Insights in Docker Compose

I'm trying to run Redis Insight in Docker Compose and I always get errors even though the only thing I'm changing from the Docker Run command is the volume. How do I fix this?

docker-compose.yml

redisinsights:
  image: redislabs/redisinsight:latest
  restart: always
  ports:
    - '8001:8001'
  volumes:
    - ./data/redisinsight:/db

logs

redisinsights_1  | Process 9 died: No such process; trying to remove PID file. (/run/avahi-daemon//pid)
redisinsights_1  | Traceback (most recent call last):
redisinsights_1  |   File "./entry.py", line 11, in <module>
redisinsights_1  |   File "./startup.py", line 47, in <module>
redisinsights_1  |   File "/usr/local/lib/python3.6/site-packages/django/conf/__init__.py", line 79, in __getattr__
redisinsights_1  |     self._setup(name)
redisinsights_1  |   File "/usr/local/lib/python3.6/site-packages/django/conf/__init__.py", line 66, in _setup
redisinsights_1  |     self._wrapped = Settings(settings_module)
redisinsights_1  |   File "/usr/local/lib/python3.6/site-packages/django/conf/__init__.py", line 157, in __init__
redisinsights_1  |     mod = importlib.import_module(self.SETTINGS_MODULE)
redisinsights_1  |   File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
redisinsights_1  |     return _bootstrap._gcd_import(name[level:], package, level)
redisinsights_1  |   File "./redisinsight/settings/__init__.py", line 365, in <module>
redisinsights_1  |   File "/usr/local/lib/python3.6/os.py", line 220, in makedirs
redisinsights_1  |     mkdir(name, mode)
redisinsights_1  | PermissionError: [Errno 13] Permission denied: '/db/rsnaps'
like image 807
Samuel Corsi-House Avatar asked Jan 24 '26 13:01

Samuel Corsi-House


2 Answers

The accepted answer is deprecated, you can use now the following snippet for configuring Redis with RedisInsight using docker-compose. See the documentation here:

version: '3'

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

volumes:
  redis-insight:

If you don't want to persist the Redis Insight data, feel free to remove the volumes: definition

like image 128
Fernando Arteaga Avatar answered Jan 26 '26 23:01

Fernando Arteaga


Follow the below steps to make it work:

Step 1. Create a Docker Compose file as shown below:

version: '3'
services:
  redis:
    image: redislabs/redismod
    ports:
      - 6379:6379
  redisinsight:
    image: redislabs/redisinsight:latest
    ports:
      - '5540:5540'
    volumes:
      - ./Users/ajeetraina/data/redisinsight:/db 

Step 2. Provide sufficient permission

Go to Preference under Docker Desktop > File Sharing and add your folder structure which you want to share.

Please change the directory structure as per your environment

Step 3. Execute the Docker compose CLI

docker-compose ps
          Name                        Command               State           Ports         
------------------------------------------------------------------------------------------
pinegraph_redis_1          redis-server --loadmodule  ...   Up      0.0.0.0:6379->6379/tcp
pinegraph_redisinsight_1   bash ./docker-entry.sh pyt ...   Up      0.0.0.0:5540->5540/tcp

Go to web browser and open RedisInsight URL. Enjoy!

like image 39
ajeetraina Avatar answered Jan 27 '26 00:01

ajeetraina