debian系统 使用docker部署redis打开外网访问

72 阅读1分钟

debian系统 使用docker部署redis打开外网访问

  1. 拉取镜像

    docker pull redis:latest
    
  2. 获取配置文件

    wget https://download.redis.io/redis-stable/redis.conf
    
  3. 修改配置文件

    #bind 127.0.0.1 #允许远程连接 (注释)
    protected-mode no #保护模式
    appendonly yes #持久化
    requirepass abc1234567 #密码
    
  4. Docker Run

    docker run -p 6379:6379 -v /root/install/redis/redis.conf:/etc/redis/redis.conf -v  /pan/redis/data:/data --name ry-redis -d redis /etc/redis/redis.conf
    ​