Redis
Redis is an open-source, in-memory data structure store, used as a database, cache, and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams.
Setup
Lets start by making a folder for Redis and creating a docker-compose.yml
file.
mkdir -p ~/local-cloud/redis
Docker Compose
docker-compose.yml
networks:
proxy:
external: true
volumes:
redis:
services:
redis:
container_name: redis
hostname: redis
image: redis
restart: always
networks:
- proxy
ports:
- 6000:6379
volumes:
- redis:/data
# Labels are for traefik only
labels:
- "traefik.enable=true"
- "traefik.tcp.routers.redis.rule=HostSNI(`redis.localhost`) || HostSNI(`redis.dev.localhost`)"
- "traefik.tcp.routers.redis.entryPoints=redis"
- "traefik.tcp.routers.redis.tls=true"
- "traefik.tcp.routers.redis.service=redis"
- "traefik.tcp.services.redis.loadbalancer.server.port=6379"
Now lets start the Redis service.
docker compose up -d
You should now be able to access Redis at redis://redis.localhost:6000 or redis://redis.dev.localhost:6000 if you have the DNS setup.