Skip to content

Use Valkey as an Alternative for Redis Caching in docker-compose.yml #3065

@tokiwadai

Description

@tokiwadai

Summary

Adopt Valkey as an alternative to Redis in the development docker-compose configuration, providing a modern, open-source caching solution while maintaining full compatibility.

Motivation

  • Licensing benefits: Valkey is a Linux Foundation project fork of Redis with a more permissive license
  • Full compatibility: Valkey is 100% Redis protocol-compatible, requiring no code changes
  • Active development: Backed by major tech companies and actively maintained
  • Drop-in compatible: Uses the same commands, protocols, and client libraries

Proposed Changes

Update scripts/docker-compose.yml to use Valkey as an alternative caching solution:

Changes Made

services:
  redis:
    image: valkey/valkey:alpine          # Changed from redis:alpine
    container_name: valkey               # Changed from redis
    healthcheck:
      test: ['CMD-SHELL', 'valkey-cli ping | grep PONG']  # Changed from redis-cli
      interval: 1s
      timeout: 3s
      retries: 5
    ports:
      - '6379:6379'
    volumes:
      - ./data/valkey:/data              # Changed from ./data/redis
    command: valkey-server --appendonly yes  # Changed from redis-server

What Changed

Component Before (Redis) After (Valkey)
Docker image redis:alpine valkey/valkey:alpine
Container name redis valkey
CLI command redis-cli valkey-cli
Server command redis-server valkey-server
Data volume ./data/redis ./data/valkey

What Stayed the Same

  • Port: 6379 (Redis-compatible)
  • All Redis protocols and commands
  • Client library compatibility
  • Appendonly persistence mode
  • Health check mechanism

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions