Home  >  Article  >  Database  >  How to add redis configuration in laradock

How to add redis configuration in laradock

藏色散人
藏色散人forward
2020-07-06 13:59:013702browse

How to add redis configuration in laradock

Introduction

I wanted to modify the configuration of redis today, only to find that redis was not added during the default installation. configuration. So reinstall the configuration.

Modify Dockerfile

Edit redis/Dockerfile as follows

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"]

Edit configuration file

Default redis There is a redis.conf file in the directory. Just modify the following two points.

  • Comment bind 127.0.0.1

  • protected-mode to no

  • requirepass Set password

Other configurations can be modified according to your own situation.

  • Reinstall redis

  • Switch to laradock directory

  • Stop redis docker-compose stop redis

  • Reinstall docker-compose build --no-cache redis

  • Start docker-compose up -d redis

The startup is successful under normal circumstances.

Recommended: "redis tutorial"

The above is the detailed content of How to add redis configuration in laradock. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete