Docker Compose部署Redis

docker-compose.yml配置

version: '3'

services:
  redis:
    image: redis:latest
    container_name: redis
    restart: always
    ports:
      - 6379:6379
    volumes:
       - ./redis.conf:/etc/redis/redis.conf:rw
       - ./redis-data/:/data:rw
    command:
      # 执行的命令
      redis-server /etc/redis/redis.conf --appendonly yes

redis.conf配置

requirepass 123456
appendonly yes
daemonize no

你可能感兴趣的:(Docker Compose部署Redis)