From f69c710d91bf28e3b64114da9ff1aa7840af2b35 Mon Sep 17 00:00:00 2001 From: siujamo Date: Thu, 30 Jul 2026 14:15:17 +0800 Subject: [PATCH] feat(redis): add Redis 8 Alpine compose file - Add docker-compose.yaml with password authentication commented out by default (no password required) - Add .env.example with REDIS_PASSWORD documented and commented out --- compose/redis/.env.example | 9 +++++++++ compose/redis/docker-compose.yaml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 compose/redis/.env.example create mode 100644 compose/redis/docker-compose.yaml diff --git a/compose/redis/.env.example b/compose/redis/.env.example new file mode 100644 index 0000000..7e42933 --- /dev/null +++ b/compose/redis/.env.example @@ -0,0 +1,9 @@ +# Redis (Alpine) — environment variables +# Copy this file to .env and adjust values for your environment. + +# Password for client connections. By default Redis starts with no password +# (any client can connect). To require authentication: +# 1. Set REDIS_PASSWORD below +# 2. Uncomment the "command" line in docker-compose.yaml +# Clients authenticate with: AUTH +# REDIS_PASSWORD=redis diff --git a/compose/redis/docker-compose.yaml b/compose/redis/docker-compose.yaml new file mode 100644 index 0000000..299f2fd --- /dev/null +++ b/compose/redis/docker-compose.yaml @@ -0,0 +1,30 @@ +# Docker Compose file for Redis (Alpine) +# +# Usage: +# docker compose up -d +# +# By default, Redis starts with no password — any client can connect. +# To require a password, set REDIS_PASSWORD in your .env file and uncomment +# the "command" line below. Clients must then authenticate with AUTH +# . +# +# Environment variables (see .env.example for details): +# REDIS_PASSWORD - Optional password for client connections + +services: + redis: + # For available image tags, see https://hub.docker.com/_/redis + image: redis:8-alpine + container_name: redis + # To enable password authentication, set REDIS_PASSWORD in your .env file + # and uncomment the following line: + # command: redis-server --requirepass ${REDIS_PASSWORD} + ports: + # Map host port 6379 to container port 6379 (Redis default). + - "6379:6379" + volumes: + # Persist data beyond container lifetime. + - redis_data:/data + +volumes: + redis_data: