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

How to add redis configuration in laradock

藏色散人
Release: 2020-07-06 13:59:01
forward
3851 people have browsed it

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"]
Copy after login

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!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template