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
- Create a working directory named after the service.
- Copy the compose file and generated `.env` into that directory.
- Review the variables and replace placeholders with real values.
- Run `docker compose up -d`.
mkdir redis
cd redis
# create docker-compose.yml
# create .env
docker compose up -d