docker-compose安装redis 发表于 2021-03-12 | 分类于 docker-compose | 阅读次数: | 阅读次数: | 403 | 1 分钟 编写yml文件 123456789101112version: '3'services: redis: image: redis:latest restart: always container_name: redis-server command: redis-server /etc/redis/redis.conf volumes: - /root/middleware/redis/data:/data - /root/middleware/redis/redis.conf:/etc/redis/redis.conf ports: - "6379:6379" 同级目录中创建配置文件 reids.conf 12requirepass 123456appendonly yes 启动镜像 1docker-compose up -d -------------本文结束 感谢您的阅读-------------