redis

部署

1.新建runtime文件夹

2.编写生成docker-compose.yaml文件

  redis:
    image: redis:3.2.3
    container_name: redis_3_2
    restart: always
    ports:
      - 56379:6379
    volumes:
      - ./runtime/redis/data:/data
    command: redis-server --appendonly yes --requirepass Zdww2021

  mysql:
    image: mysql:5.7.23
    restart: always
    container_name: mysql_5_7
    environment:
      - MYSQL_ROOT_PASSWORD=Zdww2021
      - MYSQL_USER=admin
      - MYSQL_PASS=meiyoumima
    ports:
      - 53306:3306
    volumes:
      - ./runtime/mysql/data:/var/lib/mysql
      - ./runtime/mysql/conf/my.cnf:/etc/my.cnf
      - ./runtime/mysql/init:/docker-entrypoint-initdb.d/

3.启动服务:

docker-compose up -d

posted @ 2022-03-11 16:16  水木神舟10  阅读(26)  评论(0编辑  收藏  举报