-
Notifications
You must be signed in to change notification settings - Fork 379
Add Redis Container
ucan-lab edited this page Jun 14, 2023
·
14 revisions
https://hub.docker.com/_/redis
volumes:
redis-store:
services:
redis:
image: redis:6.2-alpine
volumes:
- type: volume
source: redis-store
target: /data
volume:
nocopy: true
https://github.com/phpredis/phpredis.git
RUN git clone https://github.com/phpredis/phpredis.git /usr/src/php/ext/redis
RUN docker-php-ext-install redis
REDIS_HOST=redis
CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
Since Laravel5.7, it has changed from QUEUE_DRIVER
to QUEUE_CONNECTION
.
https://github.com/laravel/laravel/releases/tag/v5.7.0
$ make tinker
use Illuminate\Support\Facades\Redis;
Redis::set('name', 'hoge');
Redis::get('name');
$ docker compose exec redis redis-cli
> flushall
OK
> set name "hoge"
OK
> get name
"hoge"