docker-compose搭建redis

文章目录

      • 1.准备docker-compose.yml文件
      • 2.准备挂载文件redis.conf
      • 3.修改redis.conf文件配置
      • 4.安装Redis-Desktop-Manager图形化界面查看效果

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图形化界面查看效果

docker-compose搭建redis_第1张图片

你可能感兴趣的:(SpringClound)