Sign inSign up

infracamp/redis

By infracamp

•Updated almost 7 years ago

Redis container with presets

Image
0

10K+

infracamp/redis repository overview

⁠Infracamp Redis container (infracamp:redis)

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

⁠Presets available

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
Environment Variabledefaultdescription
MEMORYLIMIT100mbThe total Memory Limit
MAXMEMORY_POLICYallkeys-lruRemove 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

Environment Variabledefaultdescription
`SNAPSHOT_INTERVAL60Make snapshot every 60 seconds

Redis data is stored to /data inside the container. Make sure you have a volume mounted there - otherwise the data will be lost after restart.

Example:

services:
  redis:
    image: infracamp/redis
    environment:
      - PRESET=rdb_snapshots
      - MEMORYLIMIT=500mb
      - SNAPSHOT_INTERVAL=30
    volumes:
      - redisVolume:/data
⁠Append-only file persistence (AOF)

Tag summary

Content type

Image

Digest

Size

50.7 MB

Last updated

almost 7 years ago

docker pull infracamp/redis