Skip to content

Commit

Permalink
Merge pull request #22 from ddev/feat/migration
Browse files Browse the repository at this point in the history
Migration changes
  • Loading branch information
seebeen authored Sep 27, 2023
2 parents db51ed4 + 6158cc5 commit c3deaa2
Show file tree
Hide file tree
Showing 9 changed files with 5,999 additions and 5,697 deletions.
Binary file removed .yarn/install-state.gz
Binary file not shown.
874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.1.cjs

This file was deleted.

5 changes: 0 additions & 5 deletions .yarnrc.yml

This file was deleted.

44 changes: 16 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,41 @@

# ddev-redis-7 - Redis 7 container for DDEV

[![GitHub release (with filter)](https://img.shields.io/github/v/release/oblakstudio/ddev-redis-7)](https://github.com/oblakstudio/ddev-redis-7/releases)
[![Tests](https://github.com/oblakstudio/ddev-redis-7/actions/workflows/cron_tests.yml/badge.svg)](https://github.com/oblakstudio/ddev-redis-7/actions/workflows/cron_tests.yml)
[![GitHub release (with filter)](https://img.shields.io/github/v/release/ddev/ddev-redis-7)](https://github.com/ddev/ddev-redis-7/releases)
[![Tests](https://github.com/ddev/ddev-redis-7/actions/workflows/cron_tests.yml/badge.svg)](https://github.com/ddev/ddev-redis-7/actions/workflows/cron_tests.yml)
![project is maintained](https://img.shields.io/maintenance/yes/2024.svg)

</div>

This repository provides [Redis 7](https://redis.com) container for [DDEV](https://ddev.readthedocs.io/).

It is based on [redis:7.0.12-alpine](https://hub.docker.com/layers/library/redis/7.0.12-alpine/images/sha256-336ff85d67e89689913130cd7334d5eb67783d0e94362c6ce76314161aa1f0fd?context=explore) docker image and [DDEV custom compose files](https://ddev.readthedocs.io/en/stable/users/extend/custom-compose-files/)
It is based on [redis:7-alpine](https://hub.docker.com/_/redis/tags?page=1&name=7) docker image and [DDEV custom compose files](https://ddev.readthedocs.io/en/stable/users/extend/custom-compose-files/)

## Comparison to official addon
## Comparison to **v6** (`ddev/ddev-redis`)

There are a lot of differences between [official](https://github.com/ddev/ddev-redis) addon and this one
There are a lot of differences between [v6](https://github.com/ddev/ddev-redis) addon and this one

| Feature | ddev/ddev-redis | oblakstudio/ddev-redis-7 |
| ----------------- | ---------------- | ------------------------ |
| Maximum Memory | Unlimited | 512Mb |
| Persistence | No | **Yes** |
| Redis Version | 6.2.5 | 7.x |
| Image Size | 112.9Mb | 14.38Mb |
| Anonymous Volumes | On every restart | **NO** |
| Optimized config | No | **Yes** |
| Feature | ddev/ddev-redis | ddev/ddev-redis-7 |
| ----------------- | ---------------- | ----------------- |
| Maximum Memory | Unlimited | 512Mb |
| Persistence | No | **Yes** |
| Redis Version | 6.2.5 | 7.2.1 |
| Image Size | ~40Mb | ~11Mb |
| Anonymous Volumes | On every restart | **NO** |
| Optimized config | No | **Yes** |

### Anonymous volumes - Wait, what?

Official redis docker image mounts an anonymous volume on `/data` because... reasons. That volume is recreated on every restart. This one mounts the persistence directory on `/data` and names it according to the project name, and gives it a proper label. This way, each DDEV project has it's own data volume, and data can persist accordingly

![Anonymous volume in action](images/anon-volume.jpg)
Official redis docker container mounts an anonymous volume on `/data` because... reasons. That volume is recreated on every restart. This one mounts the persistence directory on `/data` and names it according to the project name, and gives it a proper label. This way, each DDEV project has it's own data volume, and data can persist accordingly

### Persistence?

Yes, persistence. This image is configured to persist data on `/data` volume. This means that if you stop the container, and start it again, the data will be there. This is useful for long-term caching of data, and for keeping the cache primed between ddev restarts.
Yes, persistence. This container is configured to persist data on `/data` volume. This means that if you stop the container, and start it again, the data will be there. This is useful for long-term caching of data, and for keeping the cache primed between ddev restarts.

## Installation

```
$ ddev get oblakstudio/ddev-redis-7
$ ddev get ddev/ddev-redis-7
$ ddev restart
```

Expand All @@ -47,21 +45,11 @@ $ ddev restart
> If needed, you can auth with a username and password.
> Username is `redis` as well.

## Configuration

### Redis Version
You can change the redis version by defining an environment variable using an `.env` file in the .ddev folder, or by exporting it in your shell.

```bash
export DDEV_REDIS_VERSION="7.2"
```
### Redis Server

Redis configuration files are split in the `.ddev/redis/conf` folder, you can modify them as you wish.
Otherwise, plugin just works out of the box.


## Commands

Addon exposes the following commands
Expand Down
16 changes: 15 additions & 1 deletion docker-compose.redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,26 @@ volumes:
services:
redis:
container_name: ddev-${DDEV_SITENAME}-redis
image: redis:${DDEV_REDIS_VERSION:-7}-alpine
hostname: ddev-${DDEV_SITENAME}-minio
image: redis:7.2-alpine
command: /etc/redis/conf/redis.conf
volumes:
- ".:/mnt/ddev_config"
- "./redis:/etc/redis/conf"
- "redis:/data"
expose:
- 6379
networks:
- default
deploy:
resources:
limits:
cpus: "2"
memory: "768M"
reservations:
cpus: "1"
memory: "512M"
restart: "no"
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
Binary file removed images/anon-volume.jpg
Binary file not shown.
Loading

0 comments on commit c3deaa2

Please sign in to comment.