转自:[Docker NextCloud Redis缓存配置 | sleele的博客](https://sleele.com/2019/04/19/docker-nextcloud-redis%e7%bc%93%e5%ad%98%e9%85%8d%e7%bd%ae/
- 部署redis容器
docker run --name redis -d redis
- 查看docker容器IP
docker inspect --format='{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)
- 修改nextcloud的配置文件
- 首先copy到本地
docker cp nextcloud-app:/var/www/html/config/config.php /tmp/
添加如下内容
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array(
'host' => '172.17.0.3',
'port' => 6379,
),
如下图,host那行换成你的redis地址
- nextcloud的配置文件config.php再copy回去
docker cp config.php nextcloud-app:/var/www/html/config/
docker exec -it nextcloud-app bash
cd /var/www/html/config/
chmod 777 config.php
exit
- 重启nextcloud,教程结束
docker restart nextcloud-app
- 其他
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array(
'host' => 'redis',
'port' => 6379,
),