docker-compose安装部署redis

version: "3.4"

services:
  redis:
    image: docker.das-security.cn/middleware/redis:7.0.12
    container_name: redis
    restart: always
    command: redis-server /usr/local/etc/redis/redis.conf --appendonly no
    volumes:
      - /etc/localtime:/etc/localtime
      - ./configs/redis/redis.conf:/usr/local/etc/redis/redis.conf
      - ../volumes/redis/data:/data
    ports:
      - 6379:6379

redis.conf中设置密码

找到

#requirepass foobared
requirepass 123456
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐