Docker image for Redis 7.4.12 on Alpine. A password is required, and append-only persistence is on.
104
Redis 7.4.12 for a private Docker network. The image is redis:7.4.12-alpine with an entrypoint that refuses to start until REDIS_PASSWORD is set.
The password is read at startup and written into /tmp/redis.conf. It is not stored in the image. The file is mode 600 and contains:
appendonly yesrequirepass from REDIS_PASSWORDprotected-mode yesbind 0.0.0.0port 6379Mount a volume on /data so the append-only file survives a restart. Changing REDIS_PASSWORD and restarting the container replaces the password in that config.
Keep port 6379 on the Docker network. This image listens on every interface inside the container, so do not publish 6379 on a public host address.
services:
redis:
image: webkutir/redis:7.4.12
restart: unless-stopped
environment:
REDIS_PASSWORD: change-me
volumes:
- redis_data:/data
networks:
app-net:
ipv4_address: 10.0.0.6
healthcheck:
test: ["CMD-SHELL", "redis-cli --no-auth-warning -a \"$$REDIS_PASSWORD\" ping | grep -q PONG"]
interval: 10s
timeout: 3s
retries: 5
networks:
app-net:
ipam:
config:
- subnet: 10.0.0.0/24
volumes:
redis_data:
A client on that network connects with the same password:
redis-cli -h 10.0.0.6 -a change-me ping
In this mail stack the container is the Bayes store for Rspamd. Point Rspamd at 10.0.0.6:6379 and give it the same REDIS_PASSWORD.
docker pull webkutir/redis:latest