• Docker中部署Mysql5.7和DbAdmin的docker-compose.yml


    一、简述

      本文讲Docker通过docker-compose.yml部署Mysql5.7和dbAdmin的方法。

    二、文件

      1、docker-compose.yml内容如下:

    version: '3'
    services:
      mysql57:
        image: mysql:5.7
        ports:
          - 0.0.0.0:3306:3306
        environment:
          - MYSQL_ROOT_PASSWORD=password001!
        volumes:
          - /opt/mysql/data:/var/lib/mysql
        deploy:
          placement:
            constraints:
              - node.hostname==server1
          restart_policy:
            condition: on-failure
    
      dbAdminer:
        image: adminer
        ports:
          - 3307:8080
        deploy:
          placement:
            constraints:
              - node.hostname==server1
          restart_policy:
            condition: on-failure

      2、在宿主机上创建数据目录,来存Mysql数据库。

         mkdir /opt/mysql/data

      3、执行启动创建部署

        docker stack deploy -c docker-compose.yml mysql57

      4、停止部署

        docker stack rm mysql57

  • 相关阅读:
    Daily Scrum (2015/10/28)
    Dailu Scrum (2015/10/27)
    wenbao与cmd
    wenbao与IIS
    wenbao与模板
    wenbao与git
    wenbao与vscode
    wenbao与矩阵
    wenbao与面试题
    wenbao 与将linux系统(kali)装入U盘
  • 原文地址:https://www.cnblogs.com/songxingzhu/p/10650824.html
Copyright © 2020-2023  润新知