Sign inSign up

timtosi/redis

By timtosi

•Updated over 9 years ago

These files are intended to provide a ready-to-use redis environment based on Docker.

Image
1

523

timtosi/redis repository overview

⁠Redis Docker

⁠Overview

These files are intended to provide a ready-to-use redis⁠ environment based on Docker.

Dockerfiles, Compose files and documentation are available here⁠. If you intend to follow the step-by-step tutorial, you should use the repository files.

The Dockerfile aims to be generic, easily extensible and used according to the user's will such as a redis master, a redis slave⁠ or a redis sentinel⁠.

## Quickstart

Let's start by building the Docker Image:

Redis-Build

From here you got a new shiny Docker Image of a redis server you can play with:

Redis-Test

⁠Dockerfile

The Docker Image you just created is based on Alpine⁠ distribution and its total size is 23.82 MB.

This is lightweight and that works, though I would not use it in production as it is because of my special needs. That is why you can override the redis configuration in command line without specifying a redis configuration file that would force you to create the Docker Image again.

Let's say you would like to change the port the redis server listens to:

Redis-Override

Nevertheless, you would have to specify TONS of arguments in command line, and that is not really practical.

That is why you should directly use the Compose file instead.

⁠Compose File

The present Compose file sets up a basic redis cluster composed of six services:

  • one redis master
  • two redis slaves
  • three redis sentinels
    +-------------------+    +-------------------+    +-------------------+
    |                   |    |                   |    |                   |
    | redis-sentinel-01 |    | redis-sentinel-02 |    | redis-sentinel-03 |
    |                   |    |                   |    |                   |
    +-------------------+    +-------------------+    +-------------------+
              |                        |                         |
              |                +----------------+                |
              +--------------->|                |<---------------+
                             +>|    redis-01    |<+
                             | |                | |
                             | +----------------+ |
                             |                    |
                    +----------------+    +----------------+
                    |                |    |                |
                    |    redis-02    |    |    redis-03    |
                    |                |    |                |
                    +----------------+    +----------------+

But you can use it as you want in adding or updating provided services by editing this very file.

Using this Compose file is as easy as:

Redis-Compose

⁠Not Good Enough ?

If you encouter any issue by using what is provided here, please let me know⁠ ! Help me to improve by sending your thoughts to [email protected]⁠ !

Tag summary

Content type

Image

Digest

Size

9.2 MB

Last updated

over 9 years ago

docker pull timtosi/redis