Open nemanjan00 opened 5 years ago
Pull requests for supporting alternative images more easily are welcome.
I faced the same issue with redis image version 5
$ export REDIS_IMAGE="redis"
$ export REDIS_IMAGE_VERSION="5"
$ dokku redis:create foo
$ cat /var/lib/dokku/services/redis/foo/config/redis.conf
404: Not Found
I also resolved this by editing redis.conf to update the password contained in REDIS_URL
.
Old issue: I wanted to document how I got redisJSON working in 2024 using redis-stack
### change appname and dbname to your setup
export appname="test" &&
export dbname="test-db" &&
export REDIS_IMAGE="redis/redis-stack" &&
### locate the correct redis version from the docker registry - "latest" doesn't work
export REDIS_IMAGE_VERSION="7.4.0-v0" &&
dokku redis:create $dbname &&
### enable redisJSON
echo loadmodule /opt/redis-stack/lib/rejson.so>>/var/lib/dokku/services/redis/"$dbname"/config/redis.conf &&
### restart to take effect
dokku redis:restart $dbname
dokku redis:link $dbname $appname
When I use rejson, I have problem starting server.
After this I create redis DB.
What happens next is DB is created, but docker container is constantly rebooting.
What the problem is that for some reason, redis plugin put file containing "404 Not Found" in place of redis config.
How I fixed that is:
After that, it was starting.
To make it work with app, I also had to update password in
/var/lib/dokku/services/redis/test-db/config/redis.conf
to the one in theREDIS_URL
.After it started working, I noticed REJSON does not work.
What I had to do also is to add
loadmodule /usr/lib/redis/modules/rejson.so
to/var/lib/dokku/services/redis/test-db/config/redis.conf
.Edit
Ok, apperently, this is expected behaviour, just not well documented one.
https://github.com/dokku/dokku-redis/blob/master/functions#L46
Looking at this line and one below it, we can clearly see redis repo is used for downloading default config on version basis.
Problem in this case is that rejson image version is not redis version.
Good thing is that in line 46 there is ENV variable used, so, we can provide default config ourself for rejson.
It would look something like this: