laradock 添加 redis 配置

栏目: 数据库 · 发布时间: 6年前

内容简介:今天想去修改 redis 的配置,才发现默认安装的时候并没有添加 redis 的配置。所以重装配置下。编辑默认情况

导语

今天想去修改 redis 的配置,才发现默认安装的时候并没有添加 redis 的配置。所以重装配置下。

修改 Dockerfile

编辑 redis/Dockerfile 如下

FROM redis:latest

LABEL maintainer="Mahmoud Zalt <mahmoud@zalt.me>"

## 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"]
#CMD ["redis-server"]

编辑配置文件

默认情况 redis 目录下有 redis.conf 文件,修改以下两点即可

  1. 注释 bind 127.0.0.1
  2. protected-mode 改为 no

其他配置根据自己情况进行修改。

重装 redis

laradock
docker-compose stop redis
docker-compose build --no-cache redis
docker-compose up -d redis

正常情况就启动成功了。

参考资料: laradock redis 配置记录redis解决(DENIED Redis is running in protected mode because prote)


以上所述就是小编给大家介绍的《laradock 添加 redis 配置》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Design and Analysis of Distributed Algorithms (Wiley Series on P

Design and Analysis of Distributed Algorithms (Wiley Series on P

Nicola Santoro / Wiley-Interscience / 2006-10-27 / USD 140.95

This text is based on a simple and fully reactive computational model that allows for intuitive comprehension and logical designs. The principles and techniques presented can be applied to any distrib......一起来看看 《Design and Analysis of Distributed Algorithms (Wiley Series on P》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

html转js在线工具
html转js在线工具

html转js在线工具