简体   繁体   English

如何设置Redis Commander和Docker?

[英]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.我在这里尝试了 'with docker' 文档但它无法从 localhost:7000、localhost:8081 或我使用的任何其他端口工作。 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 给了我:

$ 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 日志 rediscommander 给了我:

$ 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

Redis commader is listening on port 8081 in container. Redis 指挥官正在侦听容器中的 8081 端口。 That is why you should change port binding to这就是为什么您应该将端口绑定更改为

ports:
  - "7000:8081"

in redis commander block and access it via localhost:7000 .在 redis 命令块中并通过localhost:7000访问它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM