Skip to content
Docker Drupal Redis Sentinel
Dockerfile Shell
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.

Docker Drupal Redis Sentinel

Installing and running “redis” seem to be enough to run Drupal with it - but sometimes you want to scale Redis for HA.

Tool named “redis-sentinel” provides “redis” services such as:

  • Monitoring: It can check master or slave services whether is working correctly and healthy or not.
  • Notification: It can notify when a service goes down.
  • Automatic Failover: It starts a failover scenario and assigns one of slaves as a master when master service goes down.
  • Configuration Provider: It can configure and share master service information when a new service is added to cluster.

Redis Sentinel Drupal Docker

What do I get with this Repo?

Following services are created using Docker:

  • Redis master: Master Redis Server
  • Redis slave: Slave Redis Server
  • Redis sentinel: Sentinel Server
  • Nginx: For Drupal
  • PHP: PHP FPM for Drupal
  • MySQL: For Drupal DB

Setup Drupal + Redis + Sentinels locally

Get this repo

git clone {this_repo}

Get Drupal

Composer install Drupal

Composer install Drupal into subdir called drupal.

composer create-project drupal-composer/drupal-project:8.x-dev drupal --no-interaction

Drupal Config


Run all services locally

Get it up

docker-compose up --build -d

Scale up Redis slaves & Sentinels

docker-compose scale slave=2 sentinel=3
Creating docker_redis_sentinel_slave_2 ... done
Starting docker_redis_sentinel_sentinel_1 ... done
Creating docker_redis_sentinel_sentinel_2 ... done
Creating docker_redis_sentinel_sentinel_3 ... done

Is it up?

docker-compose ps
              Name                            Command               State           Ports
docker_redis_sentinel_db_1 mysqld      Up>3306/tcp
docker_redis_sentinel_master_1 redis ...   Up      6379/tcp
docker_redis_sentinel_php_1        docker-php-entrypoint php-fpm    Up      9000/tcp
docker_redis_sentinel_sentinel_1                    Up      6379/tcp
docker_redis_sentinel_sentinel_2                    Up      6379/tcp
docker_redis_sentinel_sentinel_3                    Up      6379/tcp
docker_redis_sentinel_slave_1 redis ...   Up      6379/tcp
docker_redis_sentinel_slave_2 redis ...   Up      6379/tcp
docker_redis_sentinel_web_1        nginx -g daemon off;             Up>80/tcp


You can’t perform that action at this time.