Hackernoon logoHow To Configure Redis + Redis Commander + Docker by@ifomin

How To Configure Redis + Redis Commander + Docker

Igor Fomin Hacker Noon profile picture

@ifominIgor Fomin

Full stack web developer, tech lead, project manager

I will get redis and redis commander up and running using docker.

Source files can be found here:

https://github.com/ikknd/docker-study in folder recipe-04

1. Create docker-compose.yml file:

Here I do several things:

  • create volume - redis-data. This is where all redis data will be stored, even if container is restarted, data will be there.
  • command: ["
    ", "
    ", "
    "] - I start redis in persistent storage mode
  • REDIS_HOSTS=local:redis:6379
    - tells redis commander how to connect to redis
    - protect redis commander interface with login/password
  • "
    " - prevents container to start before other container, on which it depends

2. Go to /var/www/docker-study.loc/recipe-04/docker/ and execute:

docker-compose up -d

If I now try

- I will see Redis Commander interface.

I can login using root/qwerty credentials.

Note: if I need to use my own redis.conf config, I can add to redis section:

    - /var/www/docker-study.loc/recipe-04/docker/redis.conf:/usr/local/etc/redis/redis.conf

and change:

command: ["redis-server", "--appendonly", "yes", "/usr/local/etc/redis/redis.conf"]

Stay Tuned!


Join Hacker Noon

Create your free account to unlock your custom reading experience.