美文网首页
docker-compose

docker-compose

作者: a丶逍遥子 | 来源:发表于2019-07-25 20:16 被阅读0次
    # Use root/example as user/password credentials
    version: '3.1'
    
    services:
      mysql:
        # 镜像
        image: "mysql:8.0.17"
        restart: always
        container_name: "mysql-10010"
        command: [
          "--character-set-server=utf8mb4",
          "--collation-server=utf8mb4_unicode_ci",
          "--default-time-zone=+8:00"
        ]
        environment:
          MYSQL_ROOT_PASSWORD: 123456
          MYSQL_USER: tiger
          MYSQL_PASS: tiger
        volumes:
          - "/docker/mysql/datadir:/var/lib/mysql"
          # - "/docker/mysql/my.cnf:/etc/mysql/my.cnf"
        ports:
          - "10010:3306"
      redis:
        image: "redis:5.0.5"
        restart: always
        container_name: "redis-10086"
        command: [
          "redis-server",
          # "/usr/local/etc/redis/redis.conf",
          "--appendonly yes"
        ]
        volumes:
          - "/redis/data:/data"
          # - "/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf"
        ports:
          - "10086:6379"
    

    相关文章

      网友评论

          本文标题:docker-compose

          本文链接:https://www.haomeiwen.com/subject/lbpkrctx.html