Skip to content

Latest commit

 

History

History
213 lines (138 loc) · 3.97 KB

README.md

File metadata and controls

213 lines (138 loc) · 3.97 KB

Redis

Docker Pulls

Redis with modules for amd64 and arm64.

Default redis.conf can be enriched from environment variables.

Modules

Image variants (tags)

latest

Latest stable version.

v* (Recommended)

Specific stable version. v7.0.2 for example.

main

Latest main branch build. Should be stable, but doesn't have to be. For latest stable and tested version, use latest instead.

edge

Experimental version for developers. May not work at all. Do not use if you don't know what you do.

How to use this image

Start instance

docker run -d --name redis zeroteampro/redis
# Alternative regsitry
docker run -d --name redis registry.zero-team.pro/redis

Start instance with mounted storage

docker run -d --name redis -v /opt/project/redis:/data zeroteampro/redis

Start instance specific variant

docker run -d --name redis zeroteampro/redis:<version>

Open port

docker run -d --name redis -p 6379:6379 zeroteampro/redis

Default redis.conf enriched from environment variables

docker run -d --name redis -e REDIS_PASSWORD=verySecurePassword zeroteampro/redis

Adds requirepass verySecurePassword to default redis.conf

Redis with TLS for production

docker run -d --name redis -e REDIS_TLS_ON=true -v /path/to/certs/:/certs zeroteampro/redis

Redis with TLS for development (autogenerated certificates)

docker run -d --name redis -e REDIS_TLS_ON=true -e REDIS_TLS_GEN=true -v /path/to/certs/:/certs zeroteampro/redis

New certificates will be generated in the certs directory.

Default redis.conf enriched from your redis.custom.conf

docker run -d --name redis -v /path/to/redis.conf:/app/redis.custom.conf zeroteampro/redis

Replace default redis.conf

docker run -d --name redis -v /path/to/redis.conf:/app/redis.conf zeroteampro/redis

Note! Some environment variables can enrich /app/redis.conf. Do not use the same keys in your redis.conf and environment variables (list below).

Enrich redis.conf from environment variables

REDIS_PASSWORD

env:

REDIS_PASSWORD=somePassword

redis.conf new line:

requirepass somePassword

REDIS_MAX_MEMORY

env:

REDIS_MAX_MEMORY=2gb

redis.conf new line:

maxmemory 2gb

REDIS_SAVE

env:

REDIS_SAVE="60 1"

redis.conf new line:

save 60 1

REDIS_LOG_LEVEL

Log level notice using by default.

env:

REDIS_LOG_LEVEL=debug

redis.conf new line:

loglevel debug

REDIS_TLS_ON

env:

REDIS_TLS_ON=true

redis.conf new lines:

port 0
tls-port 6379

tls-cert-file /certs/server.crt
tls-key-file /certs/server.key
tls-ca-cert-file /certs/ca.crt
tls-dh-params-file /certs/redis.dh

REDIS_TLS_GEN

env:

REDIS_TLS_GEN=true

Generates new certificates in /certs. Do not use autogenerated certificates in production.

Custom Docker image

Dockerfile example

FROM zeroteampro/redis[:version]

COPY redis.conf /app/redis.conf

# Optional change CMD
# Default: #CMD ["/app/start-redis.sh"]

# The script copies /app/redis.conf to /usr/local/etc/redis/redis.conf,
# enriches it with environment variables, and
# runs redis-server with config /usr/local/etc/redis/redis.conf
CMD ["/app/start-redis.sh"] # Default for this image

# Change config to yours and ignore invironment variables 
# NOTE! default CMD script will use your /app/redis.conf anyway,
# but alsa enriches it with environment variables.
# Using this custom CMD ignores all environment variables
# described above.
CMD ["redis-server", "/app/redis.conf"]