docker-compose Redis Generator
Generates a ready-to-use docker-compose for Redis, publishing port 6379 with a persistent volume. Pick the image tag and spin up your local cache or broker with one command.
YAML
β
Local Redis for cache or queues
Any project with Celery, Sidekiq, BullMQ or session caching needs a Redis running somewhere, and installing it on the machine means remembering to uninstall it later. Pick the image tag (7-alpine, 7.2, whatever the project uses) and copy the YAML: a redis service, port 6379 published and the rdata volume mounted at /data, which is the working directory of the official image.
The image version is the only field, and that shapes what comes out: no password, no persistence tuning in the generated file. Redis starts with factory defaults, which write RDB snapshots into /data, and that is what makes the volume worth having; AOF stays off. To change either, add a command line to the service, such as redis-server --appendonly yes --requirepass yourpassword.
Publishing 6379 on an internet-reachable host with no password invites automated scanning, and exposed Redis instances have been a well known target for years. On a development machine it is fine. On a VPS, switch to 127.0.0.1:6379:6379 or drop the ports section entirely and rely on the internal Compose network, keeping in mind that the rule Docker adds does not respect ufw. The YAML is built in your browser.
Frequently asked questions
Where do I put the Redis password?
Do I lose data when the container restarts?
Can I use it as a queue broker?
Related Tools
docker-compose MongoDB Generator
Generates a ready-to-use docker-compose for MongoDB, with root user and password, port 27017 published and a persistent volume. You create the database after it starts.
docker-compose MySQL Generator
Generates a ready-to-use docker-compose for MySQL, with the root password, port 3306 published and a persistent volume. Pick the image tag and start the database.
Docker Run β Compose
Convert a docker run command to the equivalent docker-compose.yml automatically. Maps ports, volumes, environment variables, networks and restart policies.