Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis doesn't work #3361

Closed
efsjouw opened this issue Mar 7, 2023 · 5 comments
Closed

redis doesn't work #3361

efsjouw opened this issue Mar 7, 2023 · 5 comments

Comments

@efsjouw
Copy link

efsjouw commented Mar 7, 2023

Description:

redis doesnt appear to work, it appears unreachable or refuses connection?

using Windows / WSL / Docker Desktop setup with Laravel 9.

Expected Behavior:

connect to redis at localhost:6379

Context information:

Not much to show I just use

docker-compose up redis

and then it is not available at http://localhost:6379/

In Laravel the error "Connection refused" is shown

@parallels999
Copy link

parallels999 commented Mar 8, 2023

I have on .env

REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

And it works, but for localhost:6379, 127.0.0.1:6379 feel free to make a PR

Also

# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bind 127.0.0.1

## For security settings uncomment, make the dir, copy conf, and also start with the conf, to use it
#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"]

@rubensrocha
Copy link

.env file (Laradock), line 422:

REDIS_PASSWORD=secret_redis

.env (Laravel)
REDIS_HOST=redis
REDIS_PASSWORD=secret_redis
REDIS_PORT=6379

@makowskid
Copy link
Contributor

not a bug, just a small annoyance after .env requirements change in the meantime

whoever stumbles upon this issue - please remember to check REDIS_PASSWORD=secret_redis line in .env file

closing this issue

@myDisconnect
Copy link

This is definitely a bug, you cannot use redis without password due to docker-compose.yml

command: --requirepass ${REDIS_PASSWORD}

@makowskid
Copy link
Contributor

Why would you want to use Redis without a password?
There's a solution for it now, and it's setting the default Laradock password inside .env.
REDIS_PASSWORD=secret_redis

Doesn't it solve your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants