Stateless Redis for cache-only workloads. No RDB, No AOF. Corrupt? Restart = fresh start.
660
Custom Redis Docker image optimized for cache-only workloads. No persistence, no corruption headaches.
When Redis data is used purely as cache, persisting it to disk is unnecessary and creates a failure point — RDB/AOF files can corrupt, causing Redis to refuse startup. This image eliminates that problem entirely.
| Feature | Default Redis | This Image |
|---|---|---|
| RDB snapshots | save 3600 1 ... | Disabled (save "") |
| AOF persistence | appendonly yes | Disabled (appendonly no) |
| On corrupt data | Fails to start | Starts fresh (auto-cleanup) |
| Memory policy | noeviction | allkeys-lru (cache-optimized) |
| Default maxmemory | unlimited | 1gb |
When the container restarts, the entrypoint script automatically removes any leftover persistence files (dump.rdb, appendonly.aof) before starting Redis — ensuring a clean start every time.
| Version | Build Tag | Base Image |
|---|---|---|
| 7.2 | 7.2 | redis:7.2-alpine |
| 8.2 | 8.2 (default) | redis:8.2-alpine |
| 8.6 | 8.6 | redis:8.6-alpine |
# Build default (8.2)
docker build -t redis-stateless .
# Build specific version
docker build --build-arg REDIS_VERSION=7.2-alpine -t redis-stateless:7.2 .
docker build --build-arg REDIS_VERSION=8.2-alpine -t redis-stateless:8.2 .
docker build --build-arg REDIS_VERSION=8.6-alpine -t redis-stateless:8.6 .
# Basic
docker run -d --name redis-cache -p 6379:6379 redis-stateless
# With password
docker run -d --name redis-cache -p 6379:6379 redis-stateless --requirepass mypassword
# Override maxmemory
docker run -d --name redis-cache -p 6379:6379 redis-stateless --maxmemory 512mb
# With docker-compose (all 3 versions for testing)
docker compose up -d
The included docker-compose.yml starts all three versions for local testing:
| Service | Version | Port |
|---|---|---|
redis-7-2 | 7.2 | 6400 |
redis-8-2 | 8.2 | 6401 |
redis-8-6 | 8.6 | 6402 |
docker compose up -d # Start all
docker compose up -d redis-8-2 # Start specific version
docker compose down # Stop all
REDIS_VERSION → choose version (default: 8.2-alpine)REDIS_ARGS → extra Redis server arguments (e.g. --requirepass secret)This image relies on Coolify's control plane for environment variable management. You can pass extra arguments to redis-server by overriding the CMD:
# In Coolify or docker-compose
command: ["--requirepass", "your-password", "--maxmemory", "512mb"]
# No persistence
save ""
appendonly no
# Memory
maxmemory 1gb
maxmemory-policy allkeys-lru
# Lazy freeing (non-blocking deletes)
lazyfree-lazy-eviction yes
lazyfree-lazy-expire yes
lazyfree-lazy-server-del yes
# Network
bind 0.0.0.0
protected-mode no
Common failure scenario with default Redis:
Redis crash → corrupt dump.rdb → Redis refuses to start → application down
→ Manual intervention needed: delete dump.rdb, restart Redis, lose data anyway
With this image:
Redis crash → container restarts → entrypoint deletes leftover files → Redis starts fresh
→ Application resumes immediately, no manual intervention
For cache workloads, this is the correct tradeoff — cached data is inherently ephemeral.
Built-in health check runs every 10 seconds:
redis-cli ping → expects PONG
Docker reports container health status automatically. Use with orchestrators (Docker Swarm, Kubernetes, Coolify) for automatic restart on failure.
MIT
Content type
Image
Digest
sha256:f02638e12…
Size
26.5 MB
Last updated
4 months ago
docker pull dekadev/redis-stateless