docker-compose安装redis

docker-compose.yaml

version: "3"
services:
  redis:
    image: redis:5.0.8
    container_name: redis
    restart: always
    command: redis-server /etc/redis/redis.conf
    ports:
      - 6379:6379
    volumes:
      - /data/redis/redis.conf:/etc/redis/redis.conf
      - /data/redis/data:/data

 

redis.conf

requirepass youpass
protected-mode no

 

docker-compose up -d

posted @ 2021-06-01 12:34  loklook123  阅读(158)  评论(0编辑  收藏  举报