lettuce Docker & Self-Hosted Deployment

GitHub

Advanced Java Redis client for thread-safe sync, async, and reactive usage. Supports Cluster, Sentinel, Pipelining, and codecs.

RAW Compose
1. Pull Image (GHCR) docker pull ghcr.io/shopify/toxiproxy
2. Docker Run (1-Click Launch) docker run -d --name lettuce -p 8474:8474 --restart always ghcr.io/shopify/toxiproxy:2.8.0
3. Podman Run podman run -d --name lettuce -p 8474:8474 --restart always ghcr.io/shopify/toxiproxy:2.8.0
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://ghcr.io/shopify/toxiproxy:2.8.0
5. ORAS Pull (OCI Artifact) oras pull ghcr.io/shopify/toxiproxy:2.8.0
6. Compose Deployment docker compose up -d
src/test/resources/docker-env/docker-compose.yml
Download .yml
x-client-libs-image: &client-libs-image
  image: "${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test}:${CLIENT_LIBS_TEST_IMAGE_TAG:-${REDIS_VERSION:-8.8.0}}"
x-client-libs-stack-image: &client-libs-stack-image
  image: "${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test}:${CLIENT_LIBS_TEST_IMAGE_TAG:-${REDIS_STACK_VERSION:-${REDIS_VERSION:-8.8.0}}}"

services:
  # Test infrastructure used for simulating network issues to test multi-db client failover
  # includes standalone redis instances with toxiproxy in front of them allowing enabling/disabling
  # access to the redis instances
  toxiproxy:
    image: ghcr.io/shopify/toxiproxy:2.8.0
    ports:
      - "8474:8474"   # Admin API
      - "9479:9479"   # Proxy port for redis instance 1
      - "9480:9480"   # Proxy port for redis instance 2
      - "9481:9481"   # Proxy port for redis instance 3
    networks:
      - redis-network

  redis-standalone-multi:
    <<: *client-libs-image
    container_name: redis-failover
    environment:
      - PORT=6487
      - NODES=5
    volumes:
      - ${REDIS_ENV_WORK_DIR}/redis-standalone-multi/work:/redis/work:rw
    ports:
      - "6487:6487"
      - "6488:6488"
      - "6489:6489"
      - "6490:6490"
      - "6491:6491"
    networks:
      - redis-network

  # Standalone Redis Servers
  redis-standalone-0:
    <<: *client-libs-image
    container_name: redis-standalone-0
    environment:
      - TLS_ENABLED=yes
    volumes:
      - ./redis-standalone-0/config:/redis/config:r
      - ${REDIS_ENV_WORK_DIR}/redis-standalone-0/work:/redis/work:rw
    ports:
      - "6478:6478"
      - "6444:6444" # TLS Port
    networks:
      - redis-network

  redis-standalone-1:
    <<: *client-libs-image
    container_name: redis-standalone-1
    environment:
      - TLS_ENABLED=yes
    volumes:
      - ./redis-standalone-1/config:/redis/config:r
      - ${REDIS_ENV_WORK_DIR}/redis-standalone-1/work:/redis/work:rw
    ports:
      - "6479:6479"
      - "6486:6486"
      - "6443:6443" # TLS Port
    networks:
      - redis-network

  redis-standalone-2:
    <<: *client-libs-image
    container_name: redis-standalone-2
    volumes:
      - ./redis-standalone-2/config:/redis/config:r
    ports:
      - "6480:6480"
    networks:
      - redis-network

  redis-standalone-3:
    <<: *client-libs-image
    container_name: redis-standalone-3
    volumes:
      - ./redis-standalone-3/config:/redis/config:r
    ports:
      - "6481:6481"
    networks:
      - redis-network

  redis-standalone-4:
    <<: *client-libs-image
    container_name: redis-standalone-4
    volumes:
      - ./redis-standalone-4/config:/redis/config:r

    environment:
      - REDIS_CLUSTER=no
    ports:
      - "6484:6484"
      - "26381:26381"
    networks:
      - redis-network

  redis-standalone-5-client-cert:
    <<: *client-libs-image
    container_name: redis-standalone-5-client-cert
    environment:
      - TLS_ENABLED=yes
    volumes:
      - ./redis-standalone-5-client-cert/config:/redis/config:r
      - ${REDIS_ENV_WORK_DIR}/redis-standalone-5-client-cert/work:/redis/work:rw
    ports:
      - "6485:6485"
      - "6445:6445" # TLS Port
    networks:
      - redis-network

  redis-standalone-sentinel-controlled:
    <<: *client-libs-image
    container_name: redis-standalone-sentinel-controlled
    environment:
      - REDIS_CLUSTER=no
      - TLS_ENABLED=yes
    volumes:
      - ./redis-standalone-sentinel-controlled/config:/redis/config:r
      - ${REDIS_ENV_WORK_DIR}/redis-standalone-sentinel-controlled/work:/redis/work:rw
      - ${REDIS_ENV_WORK_DIR}:/work
    ports:
      - "26380:26380"
      - "26822:26822" # sentinel tls port
      - "26379:26379"
      - "6482:6482"
      - "6483:6483"
      - "8443:8443" # TLS Port
      - "8444:8444" # TLS Port
    networks:
      - redis-network

  standalone-stack:
    <<: *client-libs-stack-image
    environment:
      - REDIS_CLUSTER=no
      - PORT=6379
    ports:
      - "16379:6379"

  clustered-stack:
    <<: *client-libs-stack-image
    environment:
      - REDIS_CLUSTER=yes
      - PORT=36379
    ports:
      - "36379-36381:36379-36381"

  # TLS Cluster with native Redis TLS and client certificate authentication (mTLS)
  ssl-test-cluster:
    <<: *client-libs-image
    container_name: ssl-test-cluster
    environment:
      - REDIS_CLUSTER=yes
      - TLS_ENABLED=yes
    volumes:
      - ./ssl-test-cluster/config:/redis/config:r
      - ${REDIS_ENV_WORK_DIR}/ssl-test-cluster/work:/redis/work:rw
    ports:
      - "7479:7479"
      - "7480:7480"
      - "7481:7481"
      - "7443:7443"   # TLS port node 1
      - "7444:7444"   # TLS port node 2
      - "7445:7445"   # TLS port node 3
    networks:
      - redis-network

  # Non-SSL Cluster
  test-cluster:
    <<: *client-libs-image
    container_name: test-cluster
    environment:
      - REDIS_CLUSTER=yes
    volumes:
      - ./test-cluster/config:/redis/config:r
    ports:
      - "7379:7379"
      - "7380:7380"
      - "7381:7381"
      - "7382:7382"
      - "7383:7383"
      - "7384:7384"
      - "7385:7385"
      - "7582:7582"
    networks:
      - redis-network

  # Cleanup workdir using container uid/gid to avoid host permission issues.
  cleanup:
    <<: *client-libs-image
    volumes:
      - ${REDIS_ENV_WORK_DIR}:/work:rw
    entrypoint: find /work -mindepth 1 -delete
    profiles:
      - cleanup

networks:
  redis-network:
    driver: bridge