|
1 | | -[](https://github.com/ddev/ddev-redis/actions/workflows/tests.yml)  |
| 1 | +[](https://addons.ddev.com) |
| 2 | +[](https://github.com/ddev/ddev-redis/actions/workflows/tests.yml?query=branch%3Amain) |
| 3 | +[](https://github.com/ddev/ddev-redis/commits) |
| 4 | +[](https://github.com/ddev/ddev-redis/releases/latest) |
2 | 5 |
|
3 | | -## What is this? |
| 6 | +## DDEV Redis |
4 | 7 |
|
5 | | -This repository allows you to quickly install Redis into a [DDEV](https://ddev.readthedocs.io) project using the instructions below. |
| 8 | +## Overview |
6 | 9 |
|
7 | | -## Installation |
| 10 | +[Redis](https://redis.io/) is an in-memory key–value database, used as a distributed cache and message broker, with optional durability. |
| 11 | + |
| 12 | +This add-on integrates Redis into your [DDEV](https://ddev.com/) project with Redis persistence enabled by default. |
8 | 13 |
|
9 | | -For DDEV v1.23.5 or above run |
| 14 | +## Installation |
10 | 15 |
|
11 | | -```sh |
| 16 | +```bash |
12 | 17 | ddev add-on get ddev/ddev-redis |
| 18 | +ddev restart |
13 | 19 | ``` |
14 | 20 |
|
15 | | -For earlier versions of DDEV run |
| 21 | +After installation, make sure to commit the `.ddev` directory to version control. |
16 | 22 |
|
17 | | -```sh |
18 | | -ddev get ddev/ddev-redis |
19 | | -``` |
| 23 | +## Usage |
20 | 24 |
|
21 | | -Then restart your project |
| 25 | +| Command | Description | |
| 26 | +| ------- | ----------- | |
| 27 | +| `ddev redis-cli` | Run `redis-cli` inside the Redis container | |
| 28 | +| `ddev redis` | Alias for `ddev redis-cli` | |
| 29 | +| `ddev redis-flush` | Flush all cache inside the Redis container | |
| 30 | +| `ddev describe` | View service status and used ports for Redis | |
| 31 | +| `ddev logs -s redis` | Check Redis logs | |
22 | 32 |
|
23 | | -```sh |
24 | | -ddev restart |
25 | | -``` |
| 33 | +Redis is available inside Docker containers with `redis:6379`. |
| 34 | + |
| 35 | +## Redis Credentials |
| 36 | + |
| 37 | +| Field | Value | |
| 38 | +|----------|-----------------------| |
| 39 | +| Username | `redis` | |
| 40 | +| Password | `` (empty by default) | |
26 | 41 |
|
27 | | -With DDEV v1.23.5+ you can choose a different Redis tag, the command below creates a `.ddev/.env.redis` file that you can commit: |
| 42 | +## Advanced Customization |
28 | 43 |
|
29 | | -1. `ddev dotenv set .ddev/.env.redis --redis-docker-image=redis:6` |
30 | | -2. `ddev restart` |
| 44 | +To change the used Docker image: |
31 | 45 |
|
32 | | -## Explanation |
| 46 | +```bash |
| 47 | +ddev dotenv set .ddev/.env.redis --redis-docker-image=redis:7 |
| 48 | +ddev add-on get ddev/ddev-redis |
| 49 | +ddev restart |
| 50 | +``` |
33 | 51 |
|
34 | | -This Redis recipe for [DDEV](https://ddev.readthedocs.io) installs a [`.ddev/docker-compose.redis.yaml`](docker-compose.redis.yaml) using the `redis` Docker image. |
| 52 | +Make sure to commit the `.ddev/.env.redis` file to version control. |
35 | 53 |
|
36 | | -Persistence is disabled by default (see [redis.conf](./redis/redis.conf)), follow the config instructions to enable it, or switch to https://github.com/ddev/ddev-redis-7 where it is enabled by default. |
| 54 | +All customization options (use with caution): |
37 | 55 |
|
38 | | -## Interacting with Redis |
| 56 | +| Variable | Flag | Default | |
| 57 | +| -------- | ---- | ------- | |
| 58 | +| `REDIS_DOCKER_IMAGE` | `--redis-docker-image` | `redis:7` | |
39 | 59 |
|
40 | | -* The Redis instance will listen on TCP port 6379 (the Redis default). |
41 | | -* Configure your application to access Redis on the host:port `redis:6379`. |
42 | | -* To reach the Redis CLI interface, run `ddev redis-cli` to begin a session. You can also run Redis CLI commands directly on the command-line, e.g., `ddev redis-cli INFO`. |
| 60 | +## Credits |
43 | 61 |
|
44 | | -**Contributed and maintained by [@hussainweb](https://github.com/hussainweb) based on the original [ddev-contrib recipe](https://github.com/ddev/ddev-contrib/tree/master/docker-compose-services/redis) by [@gormus](https://github.com/gormus)** |
| 62 | +**Contributed by [@hussainweb](https://github.com/hussainweb) based on the original [ddev-contrib recipe](https://github.com/ddev/ddev-contrib/tree/master/docker-compose-services/redis) by [@gormus](https://github.com/gormus)** |
45 | 63 |
|
46 | | -**Co-maintained by [@stasadev](https://github.com/stasadev)** |
| 64 | +**Maintained by the [DDEV team](https://ddev.com/support-ddev/)** |
0 commit comments