fastadmin 在docker中给redis加密码(使用laradock)


redis.conf 文件修改

1
2
3
4
5
#bind 127.0.0.1

protected-mode no

requirepass 123456 #修改的密码

dockerfile 文件修改

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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

docker-compose up -d –build –force-recreate workspace php-fpm56 php-fpm redis nginx