1.安装 docker、docker-compose
2.一键安装 redis,打开文件 vi install_redis.yml
version: "3"
services:
redis:
image: 'redis:6.2'
restart: always
hostname: redis
container_name: rap-redis-6.2
ports:
- '6379:6379'
command: redis-server --appendonly yes # --requirepass 123456
volumes:
- /data/run/docker-redis/data:/data
3.执行命令
docker-compose -f ./install_redis.yml up -d