From d9583252e82cf81cdcda5e2d9e2a9091ebfcc426 Mon Sep 17 00:00:00 2001 From: StefanMoCoAt Date: Sun, 1 Feb 2026 17:55:49 +0100 Subject: [PATCH] chore(infra): migrate Redis to Valkey 9.0 and update related configs --- .env | 4 ++-- .env.example | 4 ++-- dc-infra.yaml | 14 +++++++++----- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.env b/.env index d85f2e6f..0fca24ec 100644 --- a/.env +++ b/.env @@ -26,8 +26,8 @@ POSTGRES_DB=pg-meldestelle-db POSTGRES_PORT=5432:5432 POSTGRES_DB_URL=jdbc:postgresql://postgres:5432/pg-meldestelle-db -# --- REDIS --- -REDIS_IMAGE=redis:7.4-alpine +# --- VALKEY (formerly Redis) --- +VALKEY_IMAGE=valkey/valkey:9.0 REDIS_PASSWORD=redis-password REDIS_PORT=6379:6379 REDIS_SERVER_HOSTNAME=redis diff --git a/.env.example b/.env.example index aed32d49..4f83789b 100644 --- a/.env.example +++ b/.env.example @@ -27,8 +27,8 @@ POSTGRES_USER=meldestelle POSTGRES_PASSWORD=meldestelle POSTGRES_DB=meldestelle -# --- REDIS --- -# Optional password for Redis; leave empty to disable authentication in dev +# --- VALKEY (formerly Redis) --- +# Optional password for Valkey/Redis; leave empty to disable authentication in dev REDIS_PASSWORD= # --- KEYCLOAK --- diff --git a/dc-infra.yaml b/dc-infra.yaml index 12ceef8d..8b2b2c7d 100644 --- a/dc-infra.yaml +++ b/dc-infra.yaml @@ -33,20 +33,23 @@ services: aliases: - "postgres" - # --- CACHE: Redis --- + # --- CACHE: Valkey (formerly Redis) --- redis: - image: "${REDIS_IMAGE:-redis:7.4-alpine}" + # Valkey 9.0 (User Request) + image: "${VALKEY_IMAGE:-valkey/valkey:9.0}" container_name: "${PROJECT_NAME:-meldestelle}-redis" restart: no ports: - "${REDIS_PORT:-6379:6379}" volumes: - "redis-data:/data" - - "./config/docker/redis/redis.conf:/usr/local/etc/redis/redis.conf:Z" + # Wir nutzen weiterhin die redis.conf, da Valkey kompatibel ist + - "./config/docker/redis/redis.conf:/etc/valkey/valkey.conf:Z" profiles: [ "infra", "all" ] - command: [ "sh", "-lc", "exec redis-server /usr/local/etc/redis/redis.conf --protected-mode no ${REDIS_PASSWORD:+--requirepass $REDIS_PASSWORD}" ] + # Anpassung der Binaries auf valkey-server und valkey-cli + command: [ "sh", "-lc", "exec valkey-server /etc/valkey/valkey.conf --protected-mode no ${REDIS_PASSWORD:+--requirepass $REDIS_PASSWORD}" ] healthcheck: - test: [ "CMD-SHELL", "[ -z \"$REDIS_PASSWORD\" ] && redis-cli ping | grep PONG || redis-cli -a \"$REDIS_PASSWORD\" ping | grep PONG" ] + test: [ "CMD-SHELL", "[ -z \"$REDIS_PASSWORD\" ] && valkey-cli ping | grep PONG || valkey-cli -a \"$REDIS_PASSWORD\" ping | grep PONG" ] interval: "5s" timeout: "5s" retries: "3" @@ -54,6 +57,7 @@ services: meldestelle-network: aliases: - "redis" + - "valkey" # --- SERVICE DISCOVERY: Consul --- consul: