Redis
About
Redis is an open source, in-memory data structure store, used as a database, cache, and message broker.
Installation & Basic Usage
Please see the Introduction & Concepts, then reference the examples below on adding this service to your project.
docker-compose.yml
Base: Add this section to your main docker-compose.yml
file, which will act as a "base". All environments will reference this file, so you can simply manage everything from one location.
redis:
image: redis:6
See the official Redis DockerHub page for specific version references.
docker-compose.dev.yml
Development: redis:
command: "redis-server --appendonly yes --requirepass redispassword"
volumes:
- ./_volumes/redis/data:/data
networks:
- web-dev
Redis Password
Be sure to change the "command" to use the Redis password that you want to use.
Persistent storage
All persistent storage will be located in a ./_volumes/
folder on your project.
.gitignore
Add this to your /_volumes/*
Networks
If you copy and paste from above, be sure to define your network at the bottom of the file.
networks:
web-dev:
Real-life example
See our open source project called Financial Freedom for more examples.