This is chunk of my
redis: image: redis:alpine container_name: foo_redis volumes: - ./docker/volumes/redis:/data restart: unless-stopped ports: - 6379:6379 networks: - local_network
I can guarantee that data persists between
downs because I've defined
I can prove that data is being stored physically because I see
./docker/volumes/redis on my host machine.
- When I enable debugbar I can see that route where I cache stuff has no queries.
- When I clear Laravel's cache and refresh page I see number of DB queries, second refresh - no queries. Clearly it works with no issues.
Then from my host machine I do:
docker exec -it foo_redis redis-cli
I get a prompt:
KEYS * and I get:
127.0.0.1:6379> KEYS * (empty array) 127.0.0.1:6379>
Why? What am I doing wrong? Redis seems to works fine. My Laravel app has
predis and caching works with no issues.
.env looks like:
CACHE_DRIVER=redis REDIS_CLIENT=predis REDIS_HOST=redis REDIS_PASSWORD=null REDIS_PORT=6379
When I manually put something into redis, it shows only that thing.
127.0.0.1:6379> set hello world OK 127.0.0.1:6379> get hello "world" 127.0.0.1:6379> KEYS * 1) "hello" 127.0.0.1:6379>