dockware
Search…
Redis

How to use a Redis container?

Redis is a Key/Value storage that allows you to save data outside your database with blazing fast access. Shopware supports the usage of Redis for session and cache handling. Here is a sample of a docker setup that adds a new Redis instance to your Docker network. Just add the container and make sure its on the same network.
docker-compose.yml
1
version: "3"
2
3
services:
4
5
shopware:
6
image: dockware/play:latest
7
container_name: shopware
8
ports:
9
- "80:80"
10
networks:
11
- web
12
13
redis:
14
image: redis:5.0.6
15
container_name: redis
16
networks:
17
- web
18
19
networks:
20
web:
21
external: false
Copied!

Shopware Configuration

Connection

Now make sure you configure the Redis instance to be used either for session handling, cache handling or both.
Add the following to your ".env" file:
.env (partial)
1
REDIS_SESSION_HOST=redis
2
REDIS_SESSION_PORT=6379
3
REDIS_CACHE_HOST=redis
4
REDIS_CACHE_PORT=6379
Copied!

Use Redis Caches

Please note, that you also need to use it for specific parts in Shopware.
Last modified 1mo ago