Redis: keeps connecting to instead of defined host


I’d like my sessions to be stored in Redis. However, I keep getting connect ECONNREFUSED And that’s weird because in config/redis I defined host as redis (this works in another Docker container).

connection: Env.get('REDIS_CONNECTION', 'local'),

  | local connection config
  | Configuration for a named connection.
  local: {
    host: 'redis',
    port: 6379,
    password: Env.get('REDIS_PASSWORD'),
    db: 0,
    keyPrefix: ''

I used adonis install @adonisjs/redis and added the provider like mentioned in the docs. When I change my SESSION variable to cookie everything works fine.

Any ideas?



In config/sessions.js I had to update redis: 'self::redis.default' to redis: 'self::redis.local'.

@virk I’ve created a pull request to fix this:


Merged PR, should be good now