Infracamp Redis container (
This container is build upon the official
redis-container. But it offers two extensions:
- It runs as non-root user by default
- It is easily configurable by environment variables (eg. in a docker stack)
- It comes with presets for
- In Memory only usage
- Snapshot usage
- AOF Logfiles
See the examples below on how to use the container. The container will be rebuild daily (:testing) or weekly (:latest).
Make sure no ports are exposed to the outside world - no security configuration is available. It is considered for stack-inside use only.
Configuration for all presets
||100mb||The total Memory Limit|
||allkeys-lru||Remove key by last resource usage|
Example for your stack-file to spin up a memory only redis instance with 100mb memory limit.
Memory Only (Caches, etc)
No persistence to disk. Usage for caching / volatile data only.
services: redis: image: infracamp/redis environment: - PRESET=memory_only - MEMORYLIMIT=500mb
RDB Snapshot Persistence (Session storage)
The Memory is snapshotted at specified interval to the disk. RDB is very compact and very perfomant. But you might loose between two snapshots
|`SNAPSHOT_INTERVAL||60||Make snapshot every 60 seconds|
Redis data is stored to
/datainside the container. Make sure you have a volume mounted there - otherwise the data will be lost after restart.
services: redis: image: infracamp/redis environment: - PRESET=rdb_snapshots - MEMORYLIMIT=500mb - SNAPSHOT_INTERVAL=30 volumes: - redisVolume:/data