1.準備docker-compose.yml文件
version: '3.1'
services:
redis:
image: daocloud.io/library/redis:5.0.4
restart: always
container_name: redis
environment:
- TZ=Asia/Shanghaimkdir
ports:
- 6379:6379
volumes:
- /opt/redis-compose/redis.conf:/usr/local/etc/redis/redis.conf
command: ["redis-server","/usr/local/etc/redis/redis.conf"]
2.準備掛載文件redis.conf
http://download.redis.io/releases/redis-5.0.4.tar.gz
解壓壓縮包,並且將redis.conf文件取出,放到指定位置.
3.修改redis.conf文件配置
1、將本地ip註釋
# bind 127.0.0.1
2、關閉保護機制
protected-mode no
4.安裝Redis-Desktop-Manager圖形化界面查看效果