Redis

Redis cache template with append-only persistence and password protection.

yaml

docker-compose.yml

services:
  redis:
    image: redis:7-alpine
    restart: unless-stopped
    command:
      - redis-server
      - "--appendonly"
      - "yes"
      - "--requirepass"
      - ${REDIS_PASSWORD}
    ports:
      - ${REDIS_PORT}:6379
    volumes:
      - redis_data:/data
volumes:
  redis_data:

.ENV

.env example

REDIS_PASSWORD=changeme123
REDIS_PORT=6379

deployment

Quick Start

  1. Create a working directory named after the service.
  2. Copy the compose file and generated `.env` into that directory.
  3. Review the variables and replace placeholders with real values.
  4. Run `docker compose up -d`.
mkdir redis
cd redis
# create docker-compose.yml
# create .env
docker compose up -d