Chris
Chris

Reputation: 5073

How to setup Redis Commander and Docker?

I've tried the 'with docker' docs here but it's not working from the localhost:7000, localhost:8081, or any other port I use. What am I missing?

REDIS_PORT=6379
### Redis ################################################
  redis:
    container_name: redis
    hostname: redis
    build: ./redis
    volumes:
      - ${DATA_PATH_HOST}/redis:/data
    ports:
      - "${REDIS_PORT}:6379"
    networks:
      - backend

### REDISCOMMANDER ################################################
  redis-commander:
    container_name: rediscommander
    hostname: redis-commander
    image: rediscommander/redis-commander:latest
    restart: always
    environment:
      - REDIS_HOSTS=local:redis:6379
    ports:
      - "7000:80"
    networks:
      - frontend
      - backend
    depends_on:
      - redis

Docker ps gives me:

$ docker ps
CONTAINER ID        IMAGE                                   COMMAND                  CREATED              STATUS                        PORTS                                      NAMES
042c9a2e918a        rediscommander/redis-commander:latest   "/usr/bin/dumb-init …"   About a minute ago   Up About a minute (healthy)   8081/tcp, 0.0.0.0:7000->80/tcp             rediscommander
86bc8c1ca5ff        laradock_redis                          "docker-entrypoint.s…"   About a minute ago   Up About a minute             0.0.0.0:6379->6379/tcp                     redis

Docker logs rediscommander gives me:

$ docker logs rediscommander
Creating custom redis-commander config '/redis-commander/config/local-production.json'.
Parsing 1 REDIS_HOSTS into custom redis-commander config '/redis-commander/config/local-production.json'.
node ./bin/redis-commander 
Using scan instead of keys
No Save: false
listening on 0.0.0.0:8081
access with browser at http://127.0.0.1:8081
Redis Connection redis:6379 using Redis DB #0

Upvotes: 1

Views: 2916

Answers (1)

Andrey Ponomarev
Andrey Ponomarev

Reputation: 121

Redis commader is listening on port 8081 in container. That is why you should change port binding to

ports:
  - "7000:8081"

in redis commander block and access it via localhost:7000.

Upvotes: 2

Related Questions