docker-compose搭建redis

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

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章