paint-brush
How To Configure Redis + Redis Commander + Dockerby@ifomin
17,265 reads
17,265 reads

How To Configure Redis + Redis Commander + Docker

by Igor Fomin
Igor Fomin HackerNoon profile picture

Igor Fomin

@ifomin

Full stack web developer, tech lead, project manager

January 22nd, 2020
Read on Terminal Reader
Read this story in a terminal
Print this story
Read this story w/o Javascript
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

How To Configure Redis + Redis Commander + Docker + Docker. Read my stories by Igor Fomin, a web developer, tech lead, project manager and project manager. I will get redis and redis commander up and running using docker. I start redis in persistent storage mode REDIS_HOSTS=local:redis:6379. I can login using root/qwerty credentials. I use redis command: ["redis-server", " --appendonly", "yes", " yes", "redis/redis.conf"
featured image - How To Configure Redis + Redis Commander + Docker
1x
Read by Dr. One voice-avatar

Listen to this story

Igor Fomin HackerNoon profile picture
Igor Fomin

Igor Fomin

@ifomin

Full stack web developer, tech lead, project manager

About @ifomin
LEARN MORE ABOUT @IFOMIN'S
EXPERTISE AND PLACE ON THE INTERNET.

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: ["
    redis-server
    ", "
    --appendonly
    ", "
    yes
    "] - I start redis in persistent storage mode
  • REDIS_HOSTS=local:redis:6379
    - tells redis commander how to connect to redis
  • HTTP_USER
    and
    HTTP_PASSWORD
    - protect redis commander interface with login/password
  • "
    depends_on
    " - 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

localhost:8081
- 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:

volumes:
    - /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!

L O A D I N G
. . . comments & more!

About Author

Igor Fomin HackerNoon profile picture
Igor Fomin@ifomin
Full stack web developer, tech lead, project manager

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Unni
Github
Shmovahhedi
Hashnode
X REMOVE AD