skip to Main Content

Laradock is a set of laravel related docker images (services) that can be used to get it up and running. However I can’t seem to get redis working out of the box, it has authentication issues no matter what configuration I tried. I also switched from v7 to v6 and copied someone else’s config file with no luck.

https://laradock.io/

docker-compose up -d apache2 mysql php-fpm redis

Also "protected-mode no" doesn’t even appear to work at all.

CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
SESSION_LIFETIME=480
SESSION_SAME_SITE=null

REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

default config above, connection etc. seems to be fine.

REDIS_PASSWORD=null

results in

NOAUTH Authentication required.

and

REDIS_PASSWORD=foobared

results in

WRONGPASS invalid username-password pair

I am unable to use config:clear as it keeps throwing the same error.

This is strange because laradock is basically made for laravel, and doesn’t appear to work with a default setup. Maybe our project code uses a different type/method of auth? But I don’t see this mentioned anywhere wether this is configurable or not.

I didn’t really change much about any of the dockerfiles or configurations, just added a standard apache config.

redis.conf

bind 127.0.0.1
protected-mode yes
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize no
supervised no
pidfile /var/run/redis_6379.pid
loglevel notice
logfile ""
databases 16
always-show-logo yes
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir ./
replica-serve-stale-data yes
replica-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
replica-priority 100
requirepass foobared
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
stream-node-max-bytes 4096
stream-node-max-entries 100
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes

redis Dockerfile

FROM redis:6.0.16
MAINTAINER Mahmoud Zalt <[email protected]>
RUN mkdir -p /usr/local/etc/redis
COPY redis.conf /usr/local/etc/redis/redis.conf
VOLUME /data
EXPOSE 6379
CMD ["redis-server", "/usr/local/etc/redis/redis.conf"]
#CMD ["redis-server"]

2

Answers


  1. Redis AUTH password is in laradock’s .env file

    Login or Signup to reply.
  2. At some point somebody added the password for redis (check redis docker-compose.yml section).
    It’s set in .env.

    This is the default part:

    ### REDIS #################################################
    REDIS_PORT=6379
    REDIS_PASSWORD=secret_redis
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search