version: "3.8" services: # Standalone redis-standalone: image: redis:alpine container_name: redis-standalone restart: on-failure:20 ports: - "6379:6379" volumes: - .:/config command: redis-server /config/standalone.conf # TLS redis-tls: image: docker.io/bitnami/redis container_name: redis-tls restart: on-failure:20 ports: - "6380:6379" volumes: - ./certs:/certs environment: - ALLOW_EMPTY_PASSWORD=false - REDIS_PASSWORD=pwd - REDIS_TLS_CERT_FILE=/certs/redis.crt - REDIS_TLS_KEY_FILE=/certs/redis.key - REDIS_TLS_CA_FILE=/certs/ca.crt - REDIS_TLS_ENABLED=yes - REDIS_TLS_PORT=6379 - REDIS_TLS_AUTH_CLIENTS=no # Sentinel redis-master: image: redis:alpine container_name: redis-master restart: on-failure:20 ports: - "6381:6381" command: redis-server --port 6381 redis-replica: image: redis:alpine container_name: redis-replica restart: on-failure:20 ports: - "6382:6382" command: redis-server --port 6382 --replicaof "${HOST_IP}" 6381 --slave-announce-ip "${HOST_IP}" depends_on: - redis-master redis-sentinel1: build: context: . dockerfile: ./sentinel.dockerfile image: redis-sentinel1 container_name: redis-sentinel1 restart: on-failure:20 ports: - "26379:26379" depends_on: - redis-master environment: - PORT=26379 - HOST_IP="${HOST_IP}" redis-sentinel2: build: context: . dockerfile: ./sentinel.dockerfile image: redis-sentinel2 container_name: redis-sentinel2 restart: on-failure:20 ports: - "26380:26379" depends_on: - redis-master environment: - PORT=26380 - HOST_IP="${HOST_IP}" redis-sentinel3: build: context: . dockerfile: ./sentinel.dockerfile image: redis-sentinel3 container_name: redis-sentinel3 restart: on-failure:20 ports: - "26381:26379" depends_on: - redis-master environment: - PORT=26381 - HOST_IP="${HOST_IP}" # Cluster redis-cluster: image: 'redis:alpine' command: redis-cli --cluster create "${HOST_IP}":7000 "${HOST_IP}":7001 "${HOST_IP}":7002 "${HOST_IP}":7003 "${HOST_IP}":7004 "${HOST_IP}":7005 --cluster-replicas 1 --cluster-yes container_name: redis-cluster depends_on: - redis-node1 - redis-node2 - redis-node3 - redis-node4 - redis-node5 - redis-node6 redis-node1: build: context: . dockerfile: ./cluster.dockerfile image: redis-node1 container_name: redis-node1 restart: on-failure:20 ports: - "7000:7000" - "17000:17000" environment: - PORT=7000 - BUS_PORT=17000 - HOST_IP="${HOST_IP}" redis-node2: build: context: . dockerfile: ./cluster.dockerfile image: redis-node2 container_name: redis-node2 restart: on-failure:20 ports: - "7001:7001" - "17001:17001" environment: - PORT=7001 - BUS_PORT=17001 - HOST_IP="${HOST_IP}" redis-node3: build: context: . dockerfile: ./cluster.dockerfile image: redis-node3 container_name: redis-node3 restart: on-failure:20 ports: - "7002:7002" - "17002:17002" environment: - PORT=7002 - BUS_PORT=17002 - HOST_IP="${HOST_IP}" redis-node4: build: context: . dockerfile: ./cluster.dockerfile image: redis-node4 container_name: redis-node4 restart: on-failure:20 ports: - "7003:7003" - "17003:17003" environment: - PORT=7003 - BUS_PORT=17003 - HOST_IP="${HOST_IP}" redis-node5: build: context: . dockerfile: ./cluster.dockerfile image: redis-node5 container_name: redis-node5 restart: on-failure:20 ports: - "7004:7004" - "17004:17004" environment: - PORT=7004 - BUS_PORT=17004 - HOST_IP="${HOST_IP}" redis-node6: build: context: . dockerfile: ./cluster.dockerfile image: redis-node6 container_name: redis-node6 restart: on-failure:20 ports: - "7005:7005" - "17005:17005" environment: - PORT=7005 - BUS_PORT=17005 - HOST_IP="${HOST_IP}" # RedisStack redis-stack: image: redis/redis-stack-server:7.0.6-RC5 container_name: redis-stack restart: on-failure:20 ports: - "8000:6379"